>>>RGB() takes a RED,GREEN,BLUE color componenets and converts to a unique color number. Is there a way to take the unique color number and convert to a RED,GREEN,BLUE color componenet ?
>>
>>Ron,
>>
>>You can either do the math or bit mask it (Red's in the most significant 8 bits, green in the middle, and blue in the least significant 8 bits) or, my preference, use the foxtools function RGBComp(). Here's the syntax once the library is loaded:
>>STORE 0 TO lnred, lngreen, lnblue
>>= RGBComp(lncolor, @lnred, @lngreen, @lnblue)
>
>What is the math and or how would I bitmask it. I assume it it is complicated because I have seen the same reply in regards to Foxtools in history search but I have not seen the math.
>
>I would rather not to tie myself to Foxtools. This app is for commercial distribution and I would prefer to keep my external dependencies down when I have a choice.
>
>If it is too time consuming to produce don't spend your time, I'll use Foxtools.
>
>Thanks
>
Ron,
Bitmasking can be done a number of ways. You could do:lntemp = lncolor
lnmask = 255
lnblue = BITAND(lntemp, lnmask)
lntemp = BITRSHIFT(lntemp, 8)
lngreen = BITAND(lntemp, lnmask)
lntemp = BITRSHIFT(lntemp, 8)
lnred = BITAND(lntemp, lnmask)Personally, I think it's more straight forward than doing the math.
George
Ubi caritas et amor, deus ibi est