Decimal Color
Code Actionscript 2.0
Frame action
createEmptyMovieClip("drawing", 1);
red = 255;
green = 255;
blue = 255;
color = (red << 16 | green << 8 | blue);
drawing.lineStyle(0, color, 100);
drawing.beginFill(color, 100);
drawing.moveTo(50, 30);
drawing.lineTo(150, 40);
drawing.lineTo(110, 150);
drawing.lineTo(30, 90);
drawing.endFill();
Code Actionscript 3.0
var drawing:MovieClip = new MovieClip(); var red = 255; var green = 128; var blue = 25; var color = (red<<16 | green<<8 | blue); drawing.graphics.lineStyle(0, color, 1); drawing.graphics.beginFill(color, 1); drawing.graphics.moveTo(50, 30); drawing.graphics.lineTo(150, 40); drawing.graphics.lineTo(110, 150); drawing.graphics.lineTo(30, 90); drawing.graphics.endFill(); this.addChild(drawing);
Description
The conversion of decimal rgb-values into hexadecimal colors is done with the instruction color = (red << 16 | green << 8 | blue); The variable color is a 24-bit integer, composed of 8 bit definitions for the red, green and blue values.
related to: Hexadecimal Color
Download
Right click: Flashfile AS 2.0 | Flashfile AS 3.0 | SWF-File