Packageardisia.utils
Classpublic final class HSVColor
InheritanceHSVColor Inheritance Object

Helper class for HSV color. Provides some useful static class functions and can also be instantiated to store a HSV color value. Used by the ColorSpacePicker class.

The Flex SDK refers to the HSV color space as the HSB color space. The Flex SDK includes a HSBColor class, but the HSBColor class isn't suitable because it cannot store a hue value of 360 which creates display problems in the ColorSpacePicker.



Public Properties
 PropertyDefined By
  brightness : Number
Brightness.
HSVColor
  hue : Number
Hue.
HSVColor
  saturation : Number
Saturation.
HSVColor
Public Methods
 MethodDefined By
  
HSVColor(hue:Number = 1, saturation:Number = 1, brightness:Number = 1)
HSVColor
  
convertHSVtoRGB(h:Number, s:Number, v:Number):uint
[static] Convert HSV color to RGB.
HSVColor
  
[static] Convert RGB color to HSV.
HSVColor
Property Detail
brightnessproperty
public var brightness:Number

Brightness. Varies from 0 to 1.

The default value is 1.

hueproperty 
hue:Number

Hue. Varies from 0 to 360.

The default value is 1.


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

Saturation. Varies from 0 to 1.

The default value is 1.

Constructor Detail
HSVColor()Constructor
public function HSVColor(hue:Number = 1, saturation:Number = 1, brightness:Number = 1)



Parameters
hue:Number (default = 1)
 
saturation:Number (default = 1)
 
brightness:Number (default = 1)
Method Detail
convertHSVtoRGB()method
public static function convertHSVtoRGB(h:Number, s:Number, v:Number):uint

Convert HSV color to RGB.

Hue set is [0, 360]; Saturation and brightness sets are [0, 1].

Parameters

h:Number — hue value
 
s:Number — saturation value
 
v:Number — brightness value

Returns
uint — the uint RGB color
convertRGBtoHSV()method 
public static function convertRGBtoHSV(rgb:uint):HSVColor

Convert RGB color to HSV.

Hue set is [0 - 360]; Saturation and Luminosity sets are [0, 1].

Parameters

rgb:uint — a RGB color value

Returns
HSVColor — An HSVColor object