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;
whi
August 22, 2006 8:34 PM
>>To: Flashcoders mailing list
>>Subject: RE: [Flashcoders] Hex colors function?
>>
>>Optimized for her pleasure:
>>
>>hex = ["00", "33", "66", "99", "CC", "FF"];
>>wsp
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] + he
uesday, August 22, 2006 3:47 PM
>>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"
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));
}
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);
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 o
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
1,2,3,4,5,6,7,8,9,A,B,C,D,E,F
function argbToHex(a,r,g,b){
return(a<<24|r<<16|g<<8|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
Pr
9 matches
Mail list logo