>> >but how to get r, g or even b?? mm�s mystery...
>>
>>myColor = rgb(12,34,56);
>>put myColor.red
>>-- 12
>>put myColor.green
>>-- 34
>>put myColor.blue
>>-- 56
>
>That doesn't help. The integer in question would be something like
>16049358. I'm trying various things to get the conversion myself,
>and I'm doing something slightly wrong.
I've worked out a simple enough integer to rgb function:
on inttorgb int
b = int mod 256
int = int / 256
g = int mod 256
int = int / 256
r = int mod 256
return rgb(r,g,b)
end
It can be made more general to allow for any base number (we're
effectively converting the number to base 256), but it's not worth
slapping in a repeat loop when the result is known to be three digits.
Going the other way should be easier, something like:
int = c.red*65536 + c.green*256 + c.blue
--
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]