eXceed69

02-22-2007, 11:57 AM

what i want to do is divide a range of colors from red to blue into 255 colors store them in an array and get them later

but do you thin I can divide the color range

I have started this but it starts at green and i cant get it to work..

im using out of sequence sin phases to get the color range but that’s about where i get stuck. I can’t divide the range into a certain amount of colors with in a color range. That doesn’t loop

var frequency = .3;

for (var i = 0; i < 32; ++i){

r = Math.sin(frequency*i + 0) * 127 + 128;

g = Math.sin(frequency*i + 2) * 127 + 128;

b = Math.sin(frequency*i +4) * 127 + 128;

var color24:Number = r << 16 | g << 8 | b

bmpData.setPixel(400, i, color24);

bmpData.setPixel(401, i, color24);

bmpData.setPixel(402, i, color24);

}

Anyone who knows how to do this please let me know

but do you thin I can divide the color range

I have started this but it starts at green and i cant get it to work..

im using out of sequence sin phases to get the color range but that’s about where i get stuck. I can’t divide the range into a certain amount of colors with in a color range. That doesn’t loop

var frequency = .3;

for (var i = 0; i < 32; ++i){

r = Math.sin(frequency*i + 0) * 127 + 128;

g = Math.sin(frequency*i + 2) * 127 + 128;

b = Math.sin(frequency*i +4) * 127 + 128;

var color24:Number = r << 16 | g << 8 | b

bmpData.setPixel(400, i, color24);

bmpData.setPixel(401, i, color24);

bmpData.setPixel(402, i, color24);

}

Anyone who knows how to do this please let me know