Adobe® Flex® 4 Language Reference
Hide Packages and Classes List |  Packages  |  Classes  |  Index  |  Appendixes
mx.utils 
HSBColor 
Packagemx.utils
Classpublic final class HSBColor
InheritanceHSBColor Inheritance Object

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

This class holds information for a color represented in HSB (Hue, Saturation, and Brightness) space. The main use of the class is simply as storage for these values, but there are also some utility functions for converting from and to RGB representations of colors.



Public Properties
 PropertyDefined By
  brightness : Number
The brightness parameter for this HSB color.
HSBColor
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  hue : Number
The hue value for the HSB color.
HSBColor
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  saturation : Number
The saturation parameter for this HSB color.
HSBColor
Public Methods
 MethodDefined By
  
HSBColor(hue:Number = NaN, saturation:Number = NaN, brightness:Number = NaN)
Constructs an HSBColor with optional parameters
HSBColor
  
convertHSBtoRGB(hue:Number, saturation:Number, brightness:Number):uint
[static] Converts an HSB color specified by the parameters to a uint RGB color.
HSBColor
  
[static] Converts a color from RGB format into an HSBColor
HSBColor
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
Returns the string representation of the specified object.
Object
 Inherited
Returns the primitive value of the specified object.
Object
Property Detail

brightness

property
brightness:Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

The brightness parameter for this HSB color. This is a value between 0 (black) and 1 (full brightness), which represents the distance from the apex of the HSB cone.



Implementation
    public function get brightness():Number
    public function set brightness(value:Number):void

hue

property 
hue:Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

The hue value for the HSB color. This represents an angle, in degrees, around the HSB cone. The supplied value will be modulated by 360 so that the stored value of hue will be in the range [0,360).



Implementation
    public function get hue():Number
    public function set hue(value:Number):void

saturation

property 
saturation:Number

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

The saturation parameter for this HSB color. This is a value between 0 (black) and 1 (full saturation), which represents the distance from the center in the HSB cone.



Implementation
    public function get saturation():Number
    public function set saturation(value:Number):void
Constructor Detail

HSBColor

()Constructor
public function HSBColor(hue:Number = NaN, saturation:Number = NaN, brightness:Number = NaN)

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Constructs an HSBColor with optional parameters

Parameters
hue:Number (default = NaN)
 
saturation:Number (default = NaN)
 
brightness:Number (default = NaN)
Method Detail

convertHSBtoRGB

()method
public static function convertHSBtoRGB(hue:Number, saturation:Number, brightness:Number):uint

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Converts an HSB color specified by the parameters to a uint RGB color.

Parameters

hue:Number
 
saturation:Number
 
brightness:Number

Returns
uint

convertRGBtoHSB

()method 
public static function convertRGBtoHSB(rgb:uint):HSBColor

Language Version: ActionScript 3.0
Product Version: Flex 4
Runtime Versions: Flash Player 10, AIR 1.5

Converts a color from RGB format into an HSBColor

Parameters

rgb:uint

Returns
HSBColor