Creates a new Color4 object from red, green, blue values, all between 0 and 1
Optional
r: numberdefines the red component (between 0 and 1, default is 0)
Optional
g: numberdefines the green component (between 0 and 1, default is 0)
Optional
b: numberdefines the blue component (between 0 and 1, default is 0)
Optional
a: numberdefines the alpha component (between 0 and 1, default is 1)
Defines the alpha component (between 0 and 1, default is 1)
Defines the blue component (between 0 and 1, default is 0)
Defines the green component (between 0 and 1, default is 0)
Defines the red component (between 0 and 1, default is 0)
Clamps the rgb values by the min and max values and stores the result into "result"
the current Color4
defines minimum clamping value (default is 0)
defines maximum clamping value (default is 1)
defines color to store the result into.
Copies the given float values into the current one
the current updated Color4 object
defines the red component to read from
defines the green component to read from
defines the blue component to read from
defines the alpha component to read from
Update the current color with values stored in an array from the starting index of the given array
the current Color4 object
defines the source array
Optional
offset: numberdefines an offset in the source array
Scale the current Color4 values by a factor and add the result to a given Color4
the unmodified current Color4
defines the scale factor
defines the Color4 object where to store the result
Multiplies the current Color4 values by scale and stores the result in "result"
the current unmodified Color4
defines the scaling factor to apply
defines the Color4 object where to store the result
Copies the given float values into the current one
the current updated Color4 object
defines the red component to read from
defines the green component to read from
defines the blue component to read from
defines the alpha component to read from
Stores from the starting index in the given array the Color4 successive values
the current Color4 object
defines the array where to store the r,g,b components
Optional
index: numberdefines an optional index in the target array to define where to start storing values
Converts the Color4 values to gamma space and stores the result in "convertedColor"
the unmodified Color4
defines the Color4 object where to store the gamma space version
Optional
exact: booleandefines if the conversion will be done in an exact way which is slower but more accurate (default is false)
Compute the Color4 hexadecimal code as a string
a string containing the hexadecimal representation of the Color4 object
Optional
returnAsColor3: booleandefines if the string should only contains RGB values (off by default)
Converts the Color4 values to linear space and stores the result in "convertedColor"
the unmodified Color4
defines the Color4 object where to store the linear space version
Optional
exact: booleandefines if the conversion will be done in an exact way which is slower but more accurate (default is false)
Static
CheckCheck the content of a given array and convert it to an array containing RGBA data If the original array was already containing count * 4 values then it is returned directly
an array containing count * 4 values (RGBA)
defines the array to check
defines the number of RGBA data to expect
Static
FromCreates a new Color4 from the starting index element of the given array
a new Color4 object
defines the source array to read from
Optional
offset: numberdefines the offset in the source array
Static
FromCreates a new Color4 from the starting index element of the given array
defines the source array to read from
defines the offset in the source array
defines the target Color4 object
Static
FromCreates a new Color4 from a Color3 and an alpha value
a new Color4 object
defines the source Color3 to read from
Optional
alpha: numberdefines the alpha component (1.0 by default)
Static
FromCreates a new Color4 from the string containing valid hexadecimal values.
A valid hex string is either in the format #RRGGBB or #RRGGBBAA.
When a hex string without alpha is passed, the resulting Color4 has its alpha value set to 1.0.
An invalid string results in a Color with all its channels set to 0.0, i.e. "transparent black".
a new Color4 object
defines a string containing valid hexadecimal values
Static
FromCreates a new Color3 from integer values (< 256)
a new Color3 object
defines the red component to read from (value between 0 and 255)
defines the green component to read from (value between 0 and 255)
defines the blue component to read from (value between 0 and 255)
defines the alpha component to read from (value between 0 and 255)
Static
HermiteInterpolate between two Color4 using Hermite interpolation
the new interpolated Color4
Static
Hermite1stReturns a new Color4 which is the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
1st derivative
defines the first control point
defines the first tangent
defines the second control point
defines the second tangent
define where the derivative must be done
Static
Hermite1stUpdate a Color4 with the 1st derivative of the Hermite spline defined by the colors "value1", "value2", "tangent1", "tangent2".
defines the first control point
defines the first tangent
defines the second control point
defines the second tangent
define where the derivative must be done
define where to store the derivative
Static
LerpStatic
LerpGenerated using TypeDoc
Class used to hold a RBGA color