-
Notifications
You must be signed in to change notification settings - Fork 149
Color
Wrapper for 24-bit colors packed as a decimal value. See the static constructors for more information.
| Parameter | Type |
|---|---|
| value | number |
| Name | Type | Description |
|---|---|---|
| b | number | The value that represents the color's blue-level. |
| g | number | The value that represents the color's green-level. |
| r | number | The value that represents the color's red-level. |
| value | number | The raw decimal value that represents the color value. |
| Parameter | Type |
|---|---|
| h | number |
| s | number |
| l | number |
Constructs a new Color object from HSL values. Hue is allowed to overflow while saturation and lightness are clamped to [0, 1].
This method only operates on data in memory.
Returns: Color
| Parameter | Type |
|---|---|
| h | number |
| s | number |
| v | number |
Constructs a new Color object from HSV values. Hue is allowed to overflow while saturation and value are clamped to [0, 1].
This method only operates on data in memory.
Returns: Color
| Parameter | Type |
|---|---|
| hex | string |
Constructs a new Color object from a hexadecimal string. The string may or may not be prefixed by #; all other characters are interpreted as a hex string.
This method only operates on data in memory.
Returns: Color
| Parameter | Type |
|---|---|
| r | number |
| g | number |
| b | number |
Constructs a new Color object from RGB values. Values are allowed to overflow though one component will not overflow to the next component.
This method only operates on data in memory.
Returns: Color
Returns a new copy of the original color object.
This method only operates on data in memory.
Returns: Color
Sets the color's blue-level.
This method only operates on data in memory.
Returns: nil
Sets the color's green-level.
This method only operates on data in memory.
Returns: nil
Sets the color's red-level.
This method only operates on data in memory.
Returns: nil
Returns the hue, saturation, and lightness that represents the color value.
This method only operates on data in memory.
Returns: number, number, number
Returns the hue, saturation, and value that represents the color value.
This method only operates on data in memory.
Returns: number, number, number
Returns a 6-digit hexadecimal string that represents the color value.
This method only operates on data in memory.
Returns: string
Returns the red, green, and blue values that are packed into the color value.
This method only operates on data in memory.
Returns: number, number, number