Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get the fourth hex value
Message
De
10/10/2012 11:09:59
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
10/10/2012 11:02:50
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:
01554669
Vues:
28
>>>I did find one adjustment so far. The last line should be:
>>>
>>>
>>>	pair2Y = rgb(pair2Yred, pair2Ygreen , pair2Yblue )
>>>
>>>
>>>This fixes that line but still results in another color than the one expected.
>>
>>While reading this thread I was about to propose something similar, but not using the difference (specially that your pair2 plus the difference may go over 255). I'd go with
>>
>>newR2=newR1*(oldR2/oldR1)
>>
>>and same for G and B.
>>
>>You could maybe achieve a similar result by taking the average of the quotients for each R, G and B.
>
>
>Ok, but newR2 may go over 255 as well

I keep thinking about that... some adjustments would be required, to keep it proportional within the 0...255 space. I can't think of the proper math at the moment, all I see are dots in intervals and some geometrical representations.

Perhaps taking the average (geometrical?) of the three quotients? Or solving for the RGB matrix (as in GDI+) which turns the Pair1x into Pair1Y, then apply the same matrix to Pair2X? It's a rather simple 3x3 system of linear equations... um, not... it has 6 variables :).

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
Répondre
Fil
Voir

Click here to load this message in the networking platform