Constructor
new Color24(ropt, gopt, bopt)
Creates a new 24-bit RGB color.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
r |
number |
<optional> |
0 | The red component. |
g |
number |
<optional> |
0 | The green component. |
b |
number |
<optional> |
0 | The blue component. |
- Source:
Members
(readonly) blue :rune.util.ColorComponent
The blue component (in 8 bits), ie, a value between 0 and 255.
Type:
- rune.util.ColorComponent
- Source:
(readonly) green :rune.util.ColorComponent
The green component (in 8 bits), ie, a value between 0 and 255.
Type:
- rune.util.ColorComponent
- Source:
(readonly) red :rune.util.ColorComponent
The red component (in 8 bits), ie, a value between 0 and 255.
Type:
- rune.util.ColorComponent
- Source:
Methods
dispose() → {undefined}
Disposes this color.
- Source:
Returns:
- Type
- undefined
random() → {undefined}
Generates a random color for this object.
- Source:
Returns:
- Type
- undefined
setRGB(r, g, b) → {undefined}
Sets the color instance to the specified RGB value.
Parameters:
Name | Type | Description |
---|---|---|
r |
number | The red component (in 8 bits), ie, a value between 0 and 255. |
g |
number | The green component (in 8 bits), ie, a value between 0 and 255. |
b |
number | The blue component (in 8 bits), ie, a value between 0 and 255. |
- Source:
Returns:
- Type
- undefined
toString() → {string}
Returns a 24-bit hex representation of this color, as a string.
- Source:
Returns:
- Type
- string
(static) fromHex(s) → {rune.color.Color24}
Creates and returns a new Color24 object, based on a hexadecimal value,
specified in string format.
Parameters:
Name | Type | Description |
---|---|---|
s |
string | String-based color code (as hexadecimal). |
- Source:
Returns:
- Type
- rune.color.Color24