Class color
color
Defined in: color.js.
Constructor Attributes | Constructor Name and Description |
---|---|
color()
Holds a standard RGBA value.
|
Field Attributes | Field Name and Description |
---|---|
Alpha/opacity component.
|
|
Alias for color.a
|
|
Blue component.
|
|
Alias for color.b
|
|
Green component.
|
|
Alias for color.g
|
|
Red component.
|
|
Alias for color.r
|
Method Attributes | Method Name and Description |
---|---|
clone()
Creates a copy of this color.
|
|
set(value)
Sets the color from a string value or color.
|
|
toString()
Converts the color into a string.
|
Class Detail
color()
Holds a standard RGBA value. See sandboxe.color.create to instantiate
it.
colors are sandboxe's primitive color type. Each component holds byte values
but are expressed as decimals from 0.0 (no intensity) to 1.0 (maximum intensity).
A notable feature is that components or arguments that except colors may
also accept string values as if calling color.set.
Field Detail
a
Alpha/opacity component. Defined from 0.0 to 1.0
alpha
Alias for color.a
b
Blue component. Defined from 0.0 to 1.0
blue
Alias for color.b
g
Green component. Defined from 0.0 to 1.0
green
Alias for color.g
r
Red component. Defined from 0.0 to 1.0
red
Alias for color.r
Method Detail
{color}
clone()
Creates a copy of this color.
- Returns:
- {color}
set(value)
Sets the color from a string value or color.
String values accepted can follow one of 2 formats:
1.) As a color name (see this list https://en.wikipedia.org/wiki/X11_color_names)
2.) As a typical hex html / css style format color (i.e. #ff00ff). Alpha channel may be included in this hex string.
- Parameters:
- {String|color} value
- The new value to set.
{String}
toString()
Converts the color into a string.
- Returns:
- {String}