class org.aswing.graphics.GradientBrush

GradientBrush encapsulate the fill paramters for flash.display.Graphics.beginGradientFill() @see http://livedocs.macromedia.com/flex/2/langref/flash/display/Graphics.html#beginGradientFill() @author paling

Class Fields

static var LINEAR:GradientType

static var RADIAL:GradientType

Instance Fields

function new(fillType:GradientType, colors:Array<Int>, alphas:Array<Dynamic>, ratios:Array<Dynamic>, matrix:Matrix, ?spreadMethod:SpreadMethod = null, ?interpolationMethod:InterpolationMethod = null, ?focalPointRatio:Float = 0): Void

Create a GradientBrush object
you can refer the explaination for the paramters from Adobe's doc to create a Matrix, you can use matrix.createGradientBox() from the matrix object itself

@see http://livedocs.macromedia.com/flex/2/langref/flash/display/Graphics.html#beginGradientFill() @see http://livedocs.macromedia.com/flex/2/langref/flash/geom/Matrix.html#createGradientBox()

function beginFill(target:Graphics): Void

@inheritDoc

function endFill(target:Graphics): Void

@inheritDoc

function getAlphas(): Array<Dynamic>

function getColors(): Array<Int>

function getMatrix(): Dynamic

function getRatios(): Array<Dynamic>

function setAlphas(alphas:Array<Dynamic>): Void

Pay attention that the value in the array should be between 0-1. if the value is greater than 1, 1 will be used, if the value is less than 0, 0 will be used

function setColors(cs:Array<Int>): Void

function setMatrix(m:Matrix): Void

function setRatios(ratios:Array<Dynamic>): Void

Ratios should be between 0-255, if the value is greater than 255, 255 will be used, if the value is less than 0, 0 will be used