Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get the fourth hex value
Message
De
10/10/2012 11:33:28
 
 
À
10/10/2012 11:29:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01554642
Message ID:
01554679
Vues:
39
>Average RGB would be r1+r2+...rn, g1+g2+...gn, b1+ b2... +bn, then divided with the number of colors in the first set. That would be the medium tone of the whole set.

Ok, I see. So, based on the image I provided for the green, I would then add them up, all the colors, and obtain the average.

>I meant that you then decide what you want the medium tone for the 2nd set to be, and then create all the colors by applying the proportion,
>
>OldColor4/OldMedium=NewColor4/NewMedium

Thanks

>IOW, make each new tone from the new medium tone, in the same proportion as one held between the corresponding tone and the medium of the first set. This should at least eliminate the rounding error that we get when some RGB components are smaller numbers. Division with a small number is the most sensitive simple operation when it comes to rounding errors, and in these darker tones we may not notice a shade being off this way or other. But when we multiply that to get a lighter shade, those errors start piling up into the lighter shades where our eyes see better.

Interesting, in deed.

>Likewise, I suspect a similar error when the starting color is too light - not as much roundoff, but simply optical error, the trick of light which would throw our judgment off, and we get surprised with the result.
>
>But as Thomas said, my method is far from perfect, there's a chance that, if you apply it to contrasting pairs, you get values over 255 or that you get something too close to zero where it shouldn't be.

For now, we will leave it as is. The green is a perfect match. But, for the blue, we'll leave that to a manual setting of the colors from the eye of a graphic artist, if needed. For now, I have provided a blue set of colors manually that is better than the original. However, this is not a deviation from the green set. If I have the time later on to fine tune the code in regards to that, I will see how using some code to calculate all the other colors could do.

Thanks for the help
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform