Package | com.gestureworks.cml.element |
Class | public class ColorPicker |
Inheritance | ColorPicker ![]() ![]() |
var cp:ColorPicker = new ColorPicker(); cp.x = 100; cp.y = 100; cp.scaleX = cp.scaleX + 1; cp.scaleY = cp.scaleY + 1; cp.addEventListener(StateEvent.CHANGE, colorSelected); addChild(cp); function colorSelected(event:StateEvent):void { //trace(event.value); }
See also
Property | Defined By | ||
---|---|---|---|
![]() | alpha : Number [override] [write-only]
sets the alpha for display objects
| ElementFactory | |
![]() | blur : Boolean
Sets the drop shadow effect
| ElementFactory | |
![]() | bottom : Number
sets the bottom value
| ElementFactory | |
![]() | class_ : String
Object's css class;
| ElementFactory | |
![]() | className : String
sets the class name of displayobject
| ElementFactory | |
![]() | cmlIndex : int
sets the cml index
| ElementFactory | |
![]() | debugStyle : *
sets the debug style
| ElementFactory | |
![]() | displayEvents : String
Use for dispatch completes. | ElementFactory | |
![]() | dropShadow : Boolean
Sets the drop shadow effect
| ElementFactory | |
![]() | height : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | heightPercent : String
sets the height percent of display object
| ElementFactory | |
![]() | horizontalCenter : Number
sets the horizontal center of display object
| ElementFactory | |
![]() | id : String
sets the id of child
| ElementFactory | |
![]() | index : int
sets the index of display object
| ElementFactory | |
labelColor : uint
The color of the labels
| ColorPicker | ||
![]() | left : Number
sets left value
| ElementFactory | |
![]() | propertyStates : Array Deprecated: Please Use state | ElementFactory | |
![]() | right : Number
sets the right value
| ElementFactory | |
![]() | scale : Number
Sets both the x and y scale values
| ElementFactory | |
![]() | scaleX : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | scaleY : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
skin : uint
The skin color of the containerRec
| ColorPicker | ||
![]() | state : Array
property states array
| ElementFactory | |
![]() | top : Number
sets top value
| ElementFactory | |
![]() | verticalCenter : Number
sets the vertical center of display object
| ElementFactory | |
![]() | width : Number [override]
Sets width of the display object in pixels
| ElementFactory | |
![]() | widthPercent : String
sets the percent of width of display object
| ElementFactory |
Method | Defined By | ||
---|---|---|---|
Constructor
| ColorPicker | ||
calculateHSBFromRGB():void
Calculates the color's HSB values from its RGB values
| ColorPicker | ||
calculateRGBFromHex():void
Calculates the selectedColor's RGB values
| ColorPicker | ||
calculateRGBFromHSB():void
Calculates the color's RGB values from its HSB values
| ColorPicker | ||
![]() | clone():*
Returns clone of self
| ElementFactory | |
displayComplete():void [override]
CML display initialization callback
| ColorPicker | ||
dispose():void [override]
Dispose method to nullify the attributes and remove listener
| ColorPicker | ||
getSelectedHexValue():String
Returns the hex representation of the selectedColor as a String
| ColorPicker | ||
init():void [override]
Initializes the components
| ColorPicker | ||
![]() | parseCML(cml:XMLList):XMLList
parses cml file
| ElementFactory | |
![]() | postparseCML(cml:XMLList):void
post parses the cml file
| ElementFactory | |
![]() | updateProperties(state:Number = 0):void
this method updates the properties
| ElementFactory |
Method | Defined By | ||
---|---|---|---|
createTextField(lab:String, _width:Number, _x:Number, _y:Number, _text:String = null, _maxChar:Number = 6):Text
Creates an editable textfield and associated label based on the provided arguments
| ColorPicker | ||
updateBaseGradient():void
Retrieve the selected hue from the hueBar and update the base color of the colorRec
| ColorPicker | ||
updateSelectedColor(color:Number = -1):void
The primary update function called each time a change event occurs. | ColorPicker |
labelColor | property |
labelColor:uint
The color of the labels
public function get labelColor():uint
public function set labelColor(value:uint):void
skin | property |
skin:uint
The skin color of the containerRec
public function get skin():uint
public function set skin(value:uint):void
ColorPicker | () | Constructor |
public function ColorPicker()
Constructor
calculateHSBFromRGB | () | method |
public function calculateHSBFromRGB():void
Calculates the color's HSB values from its RGB values
calculateRGBFromHex | () | method |
public function calculateRGBFromHex():void
Calculates the selectedColor's RGB values
calculateRGBFromHSB | () | method |
public function calculateRGBFromHSB():void
Calculates the color's RGB values from its HSB values
createTextField | () | method |
protected function createTextField(lab:String, _width:Number, _x:Number, _y:Number, _text:String = null, _maxChar:Number = 6):Text
Creates an editable textfield and associated label based on the provided arguments
Parameters
lab:String — the label name
| |
_width:Number — the width of the text field
| |
_x:Number — the x location of the text field
| |
_y:Number — the y location of the text field
| |
_text:String (default = null ) — the content of the text field
| |
_maxChar:Number (default = 6 ) — the character limit of the text field
|
Text — the resulting text element
|
displayComplete | () | method |
override public function displayComplete():void
CML display initialization callback
dispose | () | method |
override public function dispose():void
Dispose method to nullify the attributes and remove listener
getSelectedHexValue | () | method |
public function getSelectedHexValue():String
Returns the hex representation of the selectedColor as a String
ReturnsString — the hex representation of the selectedColor
|
init | () | method |
override public function init():void
Initializes the components
updateBaseGradient | () | method |
protected function updateBaseGradient():void
Retrieve the selected hue from the hueBar and update the base color of the colorRec
updateSelectedColor | () | method |
protected function updateSelectedColor(color:Number = -1):void
The primary update function called each time a change event occurs. Assigns the selectedColor value by argument or by retrieving the pixel currently selected in the colorRec, updates the color specs and adjusts the location of the colorSelector accordingly.
Parameters
color:Number (default = -1 ) — the color to assign as the selectedColor
|