to go from a 24 bit number to 3x8 bit colour components you can just shift it and mask the bits you need :

var r=color >> 16 & 0xFF
var g=color >> 8 & 0xFF
var b=color & 0xFF

that should do the job.

James Deakin wrote:
Hi Guys,

I'm having some problems with getting the brightness of a color returned
from get pixel. get pixel returns an RGB color as a number which means I was
expecting something like three groups of three numbers 255 255 255 or
similar. what I am actually getting back is of this form 14540754 one digit
short.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to