Package | com.esri.bacore.thematicmapping |
Class | public class ColorRamp |
Inheritance | ColorRamp flash.events.EventDispatcher |
Subclasses | TMColorRamp |
This class is abstract. Derived classes should implement the rampColorsCount
property and getColorByIndex
method.
Property | Defined By | ||
---|---|---|---|
isUpdatable : Boolean [read-only]
Specifies an ability to update discrete ramp colors. | ColorRamp | ||
rampColorsCount : uint
The current number of discrete colors specified in this color ramp. | ColorRamp |
Method | Defined By | ||
---|---|---|---|
Creates a new instance of the ColorRamp class. | ColorRamp | ||
getColorByIndex(index:int):uint
Gets a discrete color by index. | ColorRamp | ||
getColorByValue(value:Number):uint
Gets a gradient color by value in the range of [0, 1]. | ColorRamp | ||
mixColors(color1:uint, color2:uint, value:Number):uint [static]
Mixes color1 with color2 using linear interpolation. | ColorRamp | ||
updateRampColor(index:int, value:uint):Boolean
Updates an individual color of this color ramp with a user-defined value. | ColorRamp | ||
updateRampColors(values:Array):Boolean
Updates all colors of this color ramp with user-defined values. | ColorRamp |
Event | Summary | Defined By | ||
---|---|---|---|---|
The rampColorsChanged event is dispatched when the discrete colors of this color ramp are changed. | ColorRamp |
Constant | Defined By | ||
---|---|---|---|
RAMP_COLORS_CHANGED : String = rampColorsChanged [static]
The ColorRamp.RAMP_COLORS_CHANGED constant defines the value of the
type property of the flash.events.Event object for a rampColorsChanged event. | ColorRamp |
isUpdatable | property |
isUpdatable:Boolean
[read-only]
Specifies an ability to update discrete ramp colors.
True value means that individual colors can be updated using
updateRampColor
and updateRampColors
methods.
This property is "virtual". Its base implementation return false.
public function get isUpdatable():Boolean
rampColorsCount | property |
rampColorsCount:uint
The current number of discrete colors specified in this color ramp.
This property is "abstract". Its base implementation throws an error.
public function get rampColorsCount():uint
public function set rampColorsCount(value:uint):void
ColorRamp | () | Constructor |
public function ColorRamp()
Creates a new instance of the ColorRamp class.
getColorByIndex | () | method |
public function getColorByIndex(index:int):uint
Gets a discrete color by index.
This method is "abstract". Its base implementation throws an error.
The index
parameter value should be in the range from 0
to rampColorsCount-1
. The behavior of this method in the out-of-range
case is implementation dependent.
Parameters
index:int — Zero-based index of color in the discrete color ramp.
|
uint — Required ARGB-color.
|
getColorByValue | () | method |
public function getColorByValue(value:Number):uint
Gets a gradient color by value in the range of [0, 1].
The linear gradient color for the given value
is calculated.
The discrete colors of the color ramp are posed at the
nodes x=i/(rampColorsCount-1)
of the gradient function.
The input value
should belong to [0, 1].
If the value
is negative, the first discrete color is returned.
If the value
is greater that 1, the last discrete color is returned.
Parameters
value:Number — A value between 0 and 1 specifying a position of color in the color ramp gradient.
|
uint — Required RGB-color.
|
mixColors | () | method |
public static function mixColors(color1:uint, color2:uint, value:Number):uint
Mixes color1
with color2
using linear interpolation.
Color components are mixed by the formula:
mixedColor.X = rgbColor1.X*(1-value) + rgbColor2.X*value.
Parameters
color1:uint — The first ARGB-color.
| |
color2:uint — The second ARGB-color.
| |
value:Number — A value in the range from 0 to 1 specifying a proportion to mix colors with.
|
uint — Mixed ARGB-color.
|
updateRampColor | () | method |
public function updateRampColor(index:int, value:uint):Boolean
Updates an individual color of this color ramp with a user-defined value.
The updated color will be reset when the number of colors is changed. If the color ramp doesn't updatable, this operation is ignored. Base implementation does nothing.
Parameters
index:int — Zero-based index of color to be updated.
| |
value:uint — New value of color.
|
Boolean |
updateRampColors | () | method |
public function updateRampColors(values:Array):Boolean
Updates all colors of this color ramp with user-defined values.
The number of input colors can differ from the current number of ramp colors. In this case, the current number of colors is changed to match with the number of input colors.
The updated colors will be reset when the number of colors is changed. If the color ramp doesn't updatable, this operation is ignored. Base implementation does nothing.
Parameters
values:Array — Values of colors.
|
Boolean |
rampColorsChanged | Event |
flash.events.Event
com.esri.bacore.thematicmapping.ColorRamp.RAMP_COLORS_CHANGED
The rampColorsChanged
event is dispatched when the discrete colors of this color ramp are changed.
type
property of the flash.events.Event object for a rampColorsChanged
event.
RAMP_COLORS_CHANGED | Constant |
public static const RAMP_COLORS_CHANGED:String = rampColorsChanged
The ColorRamp.RAMP_COLORS_CHANGED constant defines the value of the
type
property of the flash.events.Event object for a rampColorsChanged
event.