mx.utils

# HSBColor - AS3 Flex

Package | mx.utils
Class | public final class HSBColor
Inheritance | HSBColor 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
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | brightness : Number The brightness parameter for this HSB color. | HSBColor
|  | constructor : 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
|  | saturation : Number The saturation parameter for this HSB color. | HSBColor

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined 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
|  | convertRGBtoHSB(rgb:uint):HSBColor [static] Converts a color from RGB format into an HSBColor. | HSBColor
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object 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`)`` — The hue.
| `saturation:Number` (default = `NaN`)`` — The saturation.
| `brightness:Number` (default = `NaN`)`` — The brightness.

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` — The hue.
| `saturation:Number` — The saturation.
| `brightness:Number` — The brightness.

Returns

| `uint` — An RGB color.

### 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` — The RGB color.

Returns

| `HSBColor` — The HSBColor object representing the RGB color.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00