Posts Tagged ‘Flash Player 10’
AS3 Circle Gradient
March 30th, 2010 • ActionScript, Flash, Projects
Tags: ActionScript, AS3, Flash, Flash Player 10, Pixelbender
According to my previous post about the AS3 Circle Color Spectrum I wanted to implement the circle gradient in pixel bender as well, so there you go. You can specify up to 4 colors and control the appearance with the corresponding ratio.
the parameters for the shader
- center for passing in the x and y
- innerRadius and outerRadius for controling the size of the circle
- rotation (0-360) to change the starting angle
- color1, color2, color3, color4 in the format RGBA (1.0, 1.0, 1.0, 1.0 = 0xffffffff)
- ratios an array of color distribution ratio
Play with the filter…
Download Circle Gradient filter & pixel bender source
AS3 Circle Color Spectrum
March 30th, 2010 • 5 comments ActionScript, Flash, Projects
Tags: ActionScript, AS3, Flash, Flash Player 10, Pixelbender
Just a few days ago I released my HSB Color Wheel interface. All the graphics used in there are drawn with the AS3 drawing API including the circle color spectrum and the circle gradient. This performs very well but just out of curiosity I wondered how hard it would be to generate the color spectrum in pixel bender … and well it’s not that complicated, actually it’s easier than doing it in AS3 because pixel bender is made for dealing with colors and pixels.
I implemented a few parameter to control the shader
- center for passing in the x and y
- innerRadius and outerRadius for controling the size of the circle
- rotation (0-360) to change the angle where the red color starts
- ratio (0.0-1.0) for controling the space used for 1 color spectrum, e.g. a value of 0.5 would use 180 degrees for displaying 1 spectrum and you would end up with 2 spectrums in your circle
is it just me or does the circle in the middle seem to rotate slightly … scary … anyway
Play with the filter…
Download Circle Color Spectrum filter & pixel bender source
next up:
AS3 Circle Gradient


