Packagepegas.draw
Classpublic final class FillGradientStyle
InheritanceFillGradientStyle Inheritance CoreObject
ImplementsIFillStyle

Defines the fill style of the vector shapes. See the flash.display.graphics.beginGradientFill method.



Public Properties
 PropertyDefined by
  alphas : Array
An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1.
FillGradientStyle
  colors : Array
An array of RGB hexadecimal color values to be used in the gradient ; for example, red is 0xFF0000, blue is 0x0000FF, and so on.
FillGradientStyle
  focalPointRatio : Number
A number that controls the location of the focal point of the gradient.
FillGradientStyle
  interpolationMethod : String
A value from the InterpolationMethod class that specifies which value to use : InterpolationMethod.linearRGB or InterpolationMethod.RGB
FillGradientStyle
  matrix : Matrix
A transformation matrix as defined by the flash.geom.Matrix class.
FillGradientStyle
  ratios : Array
An array of color distribution ratios; valid values are 0 to 255.
FillGradientStyle
  spreadMethod : String
A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.
FillGradientStyle
  type : String
A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType.RADIAL.
FillGradientStyle
Public Methods
 MethodDefined by
  
FillGradientStyle(type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)
Creates a new FillGradientStyle instance.
FillGradientStyle
 Inherited
Returns the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
hashCode():uint
Returns a hashcode value for the object.
CoreObject
  
init(graphic:Graphics):void
Initialize and launch the beginGradientFill method of the specified Graphics reference.
FillGradientStyle
 Inherited
setLogger(log:ILogger = null):void
Sets the internal ILogger reference of this ILogable object.
CoreObject
 Inherited
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
CoreObject
 Inherited
toString():String
Returns the string representation of this instance.
CoreObject
Property detail
alphasproperty
public var alphas:Array

An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.

colorsproperty 
public var colors:Array

An array of RGB hexadecimal color values to be used in the gradient ; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, be sure you specify a corresponding value in the alphas and ratios parameters.

focalPointRatioproperty 
public var focalPointRatio:Number

A number that controls the location of the focal point of the gradient. 0 means that the focal point is in the center. 1 means that the focal point is at one border of the gradient circle. -1 means that the focal point is at the other border of the gradient circle. A value less than -1 or greater than 1 is rounded to -1 or 1.

interpolationMethodproperty 
public var interpolationMethod:String

A value from the InterpolationMethod class that specifies which value to use : InterpolationMethod.linearRGB or InterpolationMethod.RGB

matrixproperty 
public var matrix:Matrix

A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.

ratiosproperty 
public var ratios:Array

An array of color distribution ratios; valid values are 0 to 255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box.

spreadMethodproperty 
public var spreadMethod:String

A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.

typeproperty 
public var type:String

A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType.RADIAL.

Constructor detail
FillGradientStyle()constructor
public function FillGradientStyle(type:String, colors:Array, alphas:Array, ratios:Array, matrix:Matrix = null, spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)

Creates a new FillGradientStyle instance.

Parameters
type:String — A value from the GradientType class that specifies which gradient type to use : GradientType.LINEAR or GradientType.RADIAL.
 
colors:Array — An array of RGB hexadecimal color values to be used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, be sure you specify a corresponding value in the alphas and ratios parameters.
 
alphas:Array — An array of alpha values for the corresponding colors in the colors array; valid values are 0 to 1. If the value is less than 0, the default is 0. If the value is greater than 1, the default is 1.
 
ratios:Array — An array of color distribution ratios; valid values are 0 to 255. This value defines the percentage of the width where the color is sampled at 100%. The value 0 represents the left-hand position in the gradient box, and 255 represents the right-hand position in the gradient box.
 
matrix:Matrix (default = null) — A transformation matrix as defined by the flash.geom.Matrix class. The flash.geom.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.
 
spreadMethod:String (default = "pad") — A value from the SpreadMethod class that specifies which spread method to use, either: SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPEAT.
 
interpolationMethod:String (default = "rgb") — A value from the InterpolationMethod class that specifies which value to use: InterpolationMethod.linearRGB or InterpolationMethod.RGB.
 
focalPointRatio:Number (default = 0) — A number that controls the location of the focal point of the gradient. 0 means that the focal point is in the center. 1 means that the focal point is at one border of the gradient circle. -1 means that the focal point is at the other border of the gradient circle. A value less than -1 or greater than 1 is rounded to -1 or 1.
Method detail
init()method
public function init(graphic:Graphics):void

Initialize and launch the beginGradientFill method of the specified Graphics reference.

Parameters
graphic:Graphics