class Color4
Creates a new Color4 object from the passed float values ( < 1) : red, green, blue, alpha.
Name | Type | Description | |
---|---|---|---|
optional | r | number | |
optional | g | number | |
optional | b | number |
Adds in place the passed Color4 values to the current Color4.
Returns the updated Color4.
Name | Type | Description | |
---|---|---|---|
right | Color4 |
Returns a new array populated with 4 numeric elements : red, green, blue, alpha values.
Stores from the starting index in the passed array the Color4 successive values.
Returns the Color4.
Name | Type | Description | |
---|---|---|---|
array | number[] | ||
optional | index | number |
Returns a new Color4 set with the added values of the current Color4 and of the passed one.
Name | Type | Description | |
---|---|---|---|
right | Color4 |
Returns a new Color4 set with the subtracted values of the passed one from the current Color4.
Name | Type | Description | |
---|---|---|---|
right | Color4 |
Subtracts the passed ones from the current Color4 values and stores the results in "result".
Returns the Color4.
Name | Type | Description | |
---|---|---|---|
right | Color4 | ||
result | Color4 |
Creates a new Color4 with the current Color4 values multiplied by scale.
Name | Type | Description | |
---|---|---|---|
scale | number |
Multiplies the current Color4 values by scale and stores the result in "result".
Returns the Color4.
Name | Type | Description | |
---|---|---|---|
scale | number | ||
result | Color4 |
Multipy an RGBA Color4 value by another and return a new Color4 object
@returns A new Color4.
Name | Type | Description | |
---|---|---|---|
color | Color4 | The Color4 (RGBA) value to multiply by |
Multipy an RGBA Color4 value by another and push the result in a reference value
@returns the result Color4.
Name | Type | Description | |
---|---|---|---|
color | Color4 | The Color4 (RGBA) value to multiply by | |
result | Color4 | The Color4 (RGBA) to fill the result in |
Returns a string with the Color4 values.
Returns the string "Color4"
Return the Color4 hash code as a number.
Creates a new Color4 copied from the current one.
Copies the passed Color4 values into the current one.
Returns the updated Color4.
Name | Type | Description | |
---|---|---|---|
source | Color4 |
Copies the passed float values into the current one.
Returns the updated Color4.
Name | Type | Description | |
---|---|---|---|
r | number | ||
g | number | ||
b | number |
Copies the passed float values into the current one.
Returns the updated Color4.
Name | Type | Description | |
---|---|---|---|
r | number | ||
g | number | ||
b | number |
Returns a string containing the hexadecimal Color4 code.
Returns a new Color4 converted to linear space.
Converts the Color4 values to linear space and stores the result in "convertedColor".
Returns the unmodified Color4.
Name | Type | Description | |
---|---|---|---|
convertedColor | Color4 |
Returns a new Color4 converted to gamma space.
Converts the Color4 values to gamma space and stores the result in "convertedColor".
Returns the unmodified Color4.
Name | Type | Description | |
---|---|---|---|
convertedColor | Color4 |
Creates a new Color4 from the valid hexadecimal value contained in the passed string.
Name | Type | Description | |
---|---|---|---|
hex | string |
Creates a new Color4 object set with the linearly interpolated values of "amount" between the left Color4 and the right Color4.
Name | Type | Description | |
---|---|---|---|
left | Color4 | ||
right | Color4 | ||
amount | number |
Set the passed "result" with the linearly interpolated values of "amount" between the left Color4 and the right Color4.
Name | Type | Description | |
---|---|---|---|
left | Color4 | ||
right | Color4 | ||
amount | number |
Creates a new Color4 from the starting index element of the passed array.
Name | Type | Description | |
---|---|---|---|
array | ArrayLike<number> | ||
optional | offset | number |
Creates a new Color4 from the passed integers ( < 256 ).
Name | Type | Description | |
---|---|---|---|
r | number | ||
g | number | ||
b | number |
Name | Type | Description | |
---|---|---|---|
colors | number[] | ||
count | number |