-
Website
http://blog.circlecube.com/ -
Original page
http://blog.circlecube.com/2008/10/tutorial/colortransform-rgb-hex-and-random-colors-actionscript-color-tutorial/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
Singh
1 comment · 1 points
-
Bart
1 comment · 1 points
-
binteali
2 comments · 1 points
-
flvplayer
1 comment · 1 points
-
circlecube
79 comments · 1 points
-
-
Popular Threads
Thanks!
@ainhoitxu - Simple really, in my example I have a movieclip containing two more clips, the inner part of the circle and the outline. Thay are seperate clips, and in the setColor(colorBall.inner, theColor); function I am sendning as an argument the colorBall.inner movieClip. I could also send in the colorBall.outline to change the color of the stroke, or like you have done and send in the whole clip as one. Make sense?
---
import flash.geom.ColorTransform;
import flash.geom.Transform;
var myTransform:Transform = new Transform(mymc);
var myColorTransform:ColorTransform = new ColorTransform();
myColorTransform.rgb = 0xFF0000;
myTransform.colorTransform = myColorTransform;
Do you know why this happens? (I use _ to make the code more readable, they're not in my AS file.)
colorBitmapData = new BitmapData(256, 256, false);
for (var i=0; i<256; i++) { ___for (var j=0; j<256; j++) {
______hex = rgb2Hex(0xFF, 0xFF, 0xFF);
______rect = new Rectangle(j, i, 1, 1);
______colorBitmapData.fillRect(rect, hex);
___};
};
private function rgb2Hex(r, g, b):Number {
___return (r<<16 || g<<8 || b);
};
I'm actually trying to create a gradient filled box which has 2 black corners, 1 white corner and 1 corner with a specified color value. But I don't seem to manage the colors good enough even for a solid fill...