API DocumentationAll Packages | All Classes | Index | Frames
ColorRamp
 
Packageweavejs.util
Classpublic class ColorRamp
InheritanceColorRamp Inheritance LinkableVariable Inheritance CallbackCollection Inheritance Object



Public Properties
 PropertyDefined By
 InheritedcallbacksAreDelayed : Boolean
[read-only]
CallbackCollection
 Inherited_linkableObject : ILinkableObject
CallbackCollection
 Inheritedlocked : Boolean
[read-only] This is set to true when lock() is called.
LinkableVariable
 Inheritedstate : Object
LinkableVariable
 InheritedtriggerCounter : uint
[read-only]
CallbackCollection
 InheritedwasDisposed : Boolean
[read-only] This flag becomes true after dispose() is called.
CallbackCollection
Protected Properties
 PropertyDefined By
 Inherited_bypassDiff : Boolean = true
If true, session states will be altered to bypass the diff calculation on DynamicState Arrays.
LinkableVariable
 Inherited_locked : Boolean = false
This is set to true when lock() is called.
LinkableVariable
 Inherited_preCallback : Function = null
This is the function that gets called immediately before every callback.
CallbackCollection
 Inherited_primitiveType : Boolean = false
This is true if the _sessionStateType is a primitive type.
LinkableVariable
 Inherited_sessionStateExternal : * = undefined
Available externally via getSessionState()
LinkableVariable
 Inherited_sessionStateInternal : * = undefined
Cannot be modified externally because it is not returned by getSessionState()
LinkableVariable
 Inherited_sessionStateType : Class = null
Type restriction passed in to the constructor.
LinkableVariable
 Inherited_sessionStateWasSet : Boolean = false
This is true if the session state has been set at least once.
LinkableVariable
 Inherited_verifier : Function = null
This function is used to prevent the session state from having unwanted values.
LinkableVariable
Public Methods
 MethodDefined By
  
ColorRamp(sessionState:Object = null)
ColorRamp
 Inherited
addDisposeCallback(relevantContext:Object, callback:Function, allowDelay:Boolean = false):void
CallbackCollection
 Inherited
addGroupedCallback(relevantContext:Object, groupedCallback:Function, triggerCallbackNow:Boolean = false, delayWhileBusy:Boolean = true):void
CallbackCollection
 Inherited
addImmediateCallback(relevantContext:Object, callback:Function, runCallbackNow:Boolean = false, alwaysCallLast:Boolean = false):void
CallbackCollection
 Inherited
CallbackCollection
 Inherited
This function may be called to detect change to a non-primitive session state in case it has been modified externally.
LinkableVariable
 Inherited
dispose():void
[override]
LinkableVariable
  
[static]
ColorRamp
  
getColor(value:Number, min:Number = 0, max:Number = 1):Number
Normalizes a value between min and max and returns an RGB hex color.
ColorRamp
  
getColorFromNorm(normValue:Number):Number
ColorRamp
  
getColorRampByName(rampName:String):Object
[static]
ColorRamp
  
getColors():Array
ColorRamp
  
getHexColor(value:Number, min:Number = 0, max:Number = 1):String
Normalizes a value between min and max and returns an RGB hex color.
ColorRamp
  
getHexColors():Array
ColorRamp
 Inherited
LinkableVariable
 Inherited
The type restriction passed in to the constructor.
LinkableVariable
 Inherited
lock():void
Call this function when you do not want to allow any more changes to the value of this sessioned property.
LinkableVariable
 Inherited
removeCallback(relevantContext:Object, callback:Function):void
CallbackCollection
 Inherited
CallbackCollection
  
reverse():void
ColorRamp
 Inherited
setSessionState(value:Object):void
LinkableVariable
 Inherited
CallbackCollection
 Inherited
verifyValue(value:Object):Boolean
This function will verify if a given value is a valid session state for this linkable variable.
LinkableVariable
Protected Methods
 MethodDefined By
 Inherited
_runCallbacksImmediately(... preCallbackParams):void
This function runs callbacks immediately, ignoring any delays.
CallbackCollection
 Inherited
sessionStateEquals(otherSessionState:*):Boolean
This function is used in setSessionState() to determine if the value has changed or not.
LinkableVariable
Public Constants
 ConstantDefined By
  allColorRamps : Array
[static]
ColorRamp
  COLOR : String = color
[static]
ColorRamp
 InheritedDEFAULT_TRIGGER_COUNT : uint = 1
[static] This is the default value of triggerCounter.
CallbackCollection
  POSITION : String = position
[static]
ColorRamp
 InheritedSTACK_TRACE_TRIGGER : String = This is the stack trace from when the callbacks were last triggered.
[static]
CallbackCollection
Constructor Detail
ColorRamp()Constructor
public function ColorRamp(sessionState:Object = null)



Parameters
sessionState:Object (default = null)
Method Detail
findMatchingColorRamp()method
public static function findMatchingColorRamp(ramp:ColorRamp):Object

Parameters

ramp:ColorRamp

Returns
Object — An Object with "name", "tags", and "colors" properties.
getColor()method 
public function getColor(value:Number, min:Number = 0, max:Number = 1):Number

Normalizes a value between min and max and returns an RGB hex color.

Parameters

value:Number — A numeric value
 
min:Number (default = 0) — The min value used for normalization
 
max:Number (default = 1) — The max value used for normalization

Returns
Number — A color represented as a Number between 0x000000 and 0xFFFFFF
getColorFromNorm()method 
public function getColorFromNorm(normValue:Number):Number

Parameters

normValue:Number — A value between 0 and 1.

Returns
Number — A color.
getColorRampByName()method 
public static function getColorRampByName(rampName:String):Object

Parameters

rampName:String

Returns
Object — An Object with "name", "tags", and "colors" properties.
getColors()method 
public function getColors():Array

Returns
Array
getHexColor()method 
public function getHexColor(value:Number, min:Number = 0, max:Number = 1):String

Normalizes a value between min and max and returns an RGB hex color.

Parameters

value:Number — A numeric value
 
min:Number (default = 0) — The min value used for normalization
 
max:Number (default = 1) — The max value used for normalization

Returns
String — A 6-digit hex color String like #FFFFFF
getHexColors()method 
public function getHexColors():Array

Returns
Array
reverse()method 
public function reverse():void

Constant Detail
allColorRampsConstant
public static const allColorRamps:Array

COLORConstant 
public static const COLOR:String = color

POSITIONConstant 
public static const POSITION:String = position