Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sort table on color ??
Message
De
29/10/1998 17:26:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00152195
Message ID:
00152541
Vues:
20
>Good day to you all,
>
>We have a table where the user can set a color to each record and the numeric value of the color is then saved in a field.
>
>We have been trying to sort the table on these colors, but we find it difficult to make them appear in some 'logical' order, for example light colors down to dark colors or different blue grouped together.
>
>We have ordered the records on the numberic value, on the red portion of them (using RGB()), the difference between the higest and the lowest RGB value etc., but we have found no satisfying solution.
>
>If anyone has a suggestion, I am all ears...

That's a really interesting problem. It's probably been done, by someone who got a Phd for the effort. The problem, like with sound frequency, is that the human perception of color is wildly non-linear with respect to the mathematical values that can be associated with the values. I played with this same problem for a while; ordering based on the R, G and B values gave an almost sensible approach. The eye is most sensitive to G so you might weight any function you use to take account of this. Something like...
Function xyz
* extract r, g, b
return 0.3*r + 0.2*g + 0.5*b
and play with that function as the index expression

Have I made it worse :-) ?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform