04-14-2011 05:22 AM - edited 04-14-2011 08:52 AM
the community of this developer forum has been among one of the best i've ever been apart of. kudos to you all who have been instrumental in its upbringing.
as a token of my appreciation, i'd like to offer some code from my own library, which hopefully some will find useful.
attached is my ColorWheel class that creates a vector graphic of the color spectrum, with or without gradating lightness. i plan on publishing it as recipe on the Adobe Developer CookBooks site in the coming weeks with a detailed explanation, but since i haven't written that yet i'll simply post the code here and offer answers to any questions.
package
{
//Imports
import com.mattie.utils.colorUtils.ColorWheel;
import com.mattie.utils.colorUtils.ColorWheelQuality;
import flash.display.Sprite;
//SWF Metadata Tag
[SWF(width="1024", height="600", frameRate="30", backgroundColor="#FFFFFF")]
//Class
public class Main extends Sprite
{
//Variables
private var rad:uint = stage.stageWidth / 6;
//Constructor
public function Main()
{
init();
}
//Initialize
private function init():void
{
var colorWheel:ColorWheel = new ColorWheel(rad, ColorWheelQuality.LOW, NaN);
colorWheel.x = rad;
var whiteWheel:ColorWheel = new ColorWheel(rad, ColorWheelQuality.LOW);
whiteWheel.x = rad * 3;
var blackWheel:ColorWheel = new ColorWheel(rad, ColorWheelQuality.LOW, 0);
blackWheel.x = rad * 5
colorWheel.y = whiteWheel.y = blackWheel.y = stage.stageHeight / 2;
addChild(colorWheel);
addChild(whiteWheel);
addChild(blackWheel);
}
}
}
class files are attached. enjoy!
[EDIT] by the way, if any of you brilliant developers have any suggestions on how to make the class better, more efficient, i'm all ears. would love to hear from you.
04-14-2011 08:30 AM
Cool.
04-14-2011 12:21 PM
04-14-2011 12:27 PM
Thanks TheDarkin1978.
04-14-2011 02:12 PM
thats some pretty sweet stuff Darkin
thanks for the contribution!!
09-15-2011 11:45 PM
Thank you. I just put it in my app: www.reelportal.com.
09-17-2011 11:18 AM
Very nice example code, thank you!