Sytze de Boer wrote:
> In VFP9, if I allow the user to choose a grid color, do I use
> mychoice=getcolor()
> It returns a number
> 
> In the grid, I need to use the RGB function of the color chosen
> How do I convert mychoice to RGB ?

Some dicking around with RGB on my part soon showed that the first 
number is whatever value from 0-255 you enter, the second value is the 
number times 256, and the third value is the number times 65536.  Then 
you add the numbers up to get the result.

For example:
RGB(1,1,1) = 1 + (1*256) + (1*65536) = 65793
rgb(2,2,2) = 2 + (2*256) + (2*65536) = 131586

Etc.  Should be pretty easy to reverse engineer it from there.



_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to