Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get the fourth hex value
Message
De
10/10/2012 11:29:28
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/10/2012 11:11:47
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:
01554677
Vues:
35
>>I think the adjustment is in the eye of the beholder. That is, whoever constructed the first pair had some preference, thinking that those two colors go well together. Now we're transposing this, keeping the proportion between RGB components of the first pair, to another pair. I guess the three ratios are not identical, i.e. the pair1X is not simply a darker version of pair1Y, but has a slight shade into any of the R, G or B directions. And this proportional method gives you the same shading over the Pair2X - with the result you may not like.
>
>This is what I thought. However, I wasn't sure about it.
>
>>Perhaps using a single color as the starting point is what throws us off? Why not use the average RGB of the whole first set (to some decimals, perhaps) for Pair1X? Then apply that to the expected medium tone of the 2nd set, and generate the whole 2nd set that way.
>
>The "average RGB" is something that is not clear to me. Could you elaborate more on this as to know what we are looking for and how to calculate it from the fact that we have a first pair for the starting point and simply one color of the second pair?

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.

>I would then assume the formula would be good for the medium tone as well.

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

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.

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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform