RE: [Flashcoders] Hex colors function?

2006-08-23 Thread Marc Hoffman
Very nice -- thanks for the lesson! -Marc At 05:33 PM 8/22/2006, you wrote: Optimized for her pleasure: hex = [00, 33, 66, 99, CC, FF]; wsp = []; var r, g, b; r = 6; var x = 0; while (--r -(-1)) { g = 6; while (--g -(-1)) { b = 6; while (--b

RE: [Flashcoders] Hex colors function?

2006-08-22 Thread Mendelsohn, Michael
function argbToHex(a,r,g,b){ return(a24|r16|g8|b); } ___ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier

Re: [Flashcoders] Hex colors function?

2006-08-22 Thread ben farrell
I guess I'd say it depends on what you're inputting to get your range. A hex color value consists of red, green and blue values. It goes 0xRRBBGG and you can probably guess which colors go where. If you don't know how to count in hex, F is the new 9. So it goes

Re: [Flashcoders] Hex colors function?

2006-08-22 Thread Marc Hoffman
The default Flash IDE palette is 216 colors, which constitute the web-safe palette. If it's of any help, the web-safe palette assigns R, G, and B each one of the following decimal values: 0 51 102 153 204 255 Convert each value to hexadecimal and create all the possible combinations of three

Re: [Flashcoders] Hex colors function?

2006-08-22 Thread Marc Hoffman
Ok, this looked like a fun project so I wrote code to construct an array of all web-safe colors: hexColors = new Array(00, 33, 66, 99, CC, FF); webSafePalette = new Array(); // length of webSafePalette will be length of hexColors cubed: for (i = 0; i Math.pow(hexColors.length, 3); i++) {

RE: [Flashcoders] Hex colors function?

2006-08-22 Thread Keith Reinfeld
Jason, I've no idea whether you have already considered this but: function rgbToHex(clr:Number):String{ var clrTrans:ColorTransform = new ColorTransform(); clrTrans.rgb = clr; return (0x + clrTrans.rgb.toString(16)); }

RE: [Flashcoders] Hex colors function?

2006-08-22 Thread Merrill, Jason
To: Flashcoders mailing list Subject: Re: [Flashcoders] Hex colors function? Ok, this looked like a fun project so I wrote code to construct an array of all web-safe colors: hexColors = new Array(00, 33, 66, 99, CC, FF); webSafePalette = new Array(); // length of webSafePalette will be length

RE: [Flashcoders] Hex colors function?

2006-08-22 Thread Steven Sacks | BLITZ
Optimized for her pleasure: hex = [00, 33, 66, 99, CC, FF]; wsp = []; var r, g, b; r = 6; var x = 0; while (--r -(-1)) { g = 6; while (--g -(-1)) { b = 6; while (--b -(-1)) { wsp[x++] = 0x + hex[r] + hex[g] + hex[b];