| Package | com.flashdynamix.motion.vectors |
| Class | public class Gradient |
| Implements | IVector |
| Property | Defined by | ||
|---|---|---|---|
| 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. | Gradient | ||
| 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. | Gradient | ||
| 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. | Gradient | ||
| height : Number | Gradient | ||
| interpolationMethod : String
A value from the InterpolationMethod class that specifies which value to use:
| Gradient | ||
| 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. | Gradient | ||
| rotation : Number | Gradient | ||
| spreadMethod : String
A value from the SpreadMethod class that specifies which spread method to use:
| Gradient | ||
| type : String
Defines the type of Gradient - this can be:
| Gradient | ||
| width : Number | Gradient | ||
| x : Number | Gradient | ||
| y : Number | Gradient | ||
| Method | Defined by | ||
|---|---|---|---|
|
Gradient(x:Number, y:Number, width:Number, height:Number, rotation:Number, colors:Array, alphas:Array, ratios:Array, type:String = "linear", spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)
| Gradient | ||
|
draw(vector:Graphics, rect:Rectangle):void
Draws the Gradient into the Graphics instance provided.
| Gradient | ||
| alphas | property |
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.
| colors | property |
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.
| focalPointRatio | property |
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.
| height | property |
height:Number [read-write]Implementation
public function get height():Number
public function set height(value:Number):void
| interpolationMethod | property |
public var interpolationMethod:StringA value from the InterpolationMethod class that specifies which value to use:
| ratios | property |
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.
| rotation | property |
rotation:Number [read-write]Implementation
public function get rotation():Number
public function set rotation(value:Number):void
| spreadMethod | property |
public var spreadMethod:StringA value from the SpreadMethod class that specifies which spread method to use:
| type | property |
public var type:StringDefines the type of Gradient - this can be:
| width | property |
width:Number [read-write]Implementation
public function get width():Number
public function set width(value:Number):void
| x | property |
x:Number [read-write]Implementation
public function get x():Number
public function set x(value:Number):void
| y | property |
y:Number [read-write]Implementation
public function get y():Number
public function set y(value:Number):void
| Gradient | () | constructor |
public function Gradient(x:Number, y:Number, width:Number, height:Number, rotation:Number, colors:Array, alphas:Array, ratios:Array, type:String = "linear", spreadMethod:String = "pad", interpolationMethod:String = "rgb", focalPointRatio:Number = 0)Parameters
x:Number — The current x position in pixels for the Gradient.
|
|
y:Number — The current y position in pixels for the Gradient.
|
|
width:Number — The current width in pixels for the Gradient.
|
|
height:Number — The current height in pixels for the Gradient.
|
|
rotation:Number — The current rotation in degrees for the Gradient.
|
|
colors:Array — An Array of RGB hexadecimal color values to be used in the gradient.
|
|
alphas:Array — An Array of alpha values for the corresponding colors in the colors Array.
|
|
ratios:Array — An Array of color distribution ratios; valid values are 0 to 255.
|
|
type:String (default = "linear") — Defines the type of Gradient - this can be either GradientType.LINEAR or GradientType.RADIAL.
|
|
spreadMethod:String (default = "pad") — A value from the SpreadMethod class that specifies which spread method to use this can be either SpreadMethod.PAD, SpreadMethod.REFLECT, or SpreadMethod.REPLAY.
|
|
interpolationMethod:String (default = "rgb") — A value from the InterpolationMethod class that specifies which value to use this can be either InterpolationMethod.linearRGB or InterpolationMethod.RGB.
|
|
focalPointRatio:Number (default = 0) — A number that controls the location of the focal point of the Gradient.
|
| draw | () | method |
public function draw(vector:Graphics, rect:Rectangle):voidDraws the Gradient into the Graphics instance provided.
Parametersvector:Graphics |
|
rect:Rectangle |