ColorRGBA
¶
Color with 4 floating point components: red, green, blue and alpha (r, g, b, a). \ingroup Math
Functions which can be used to create new instances of ColorRGBA.
ColorRGBA() | Default constructor, initializes the color to (0.0, 0.0, 0.0, 0.0) |
ColorRGBA() | Constructor, initializes the color to (v, v, v, v) |
ColorRGBA() | Constructor, initializes the color to (r, g, b, 1.0) |
ColorRGBA() | Constructor, initializes the color to (r, g, b, a) |
Default constructor, initializes the color to (0.0, 0.0, 0.0, 0.0).
local colorrgba = ColorRGBA()
Constructor, initializes the color to (v, v, v, v).
local colorrgba = ColorRGBA(v)
v | (float) | Red, Green, Blue, and Alpha component of the color. |
Constructor, initializes the color to (r, g, b, 1.0).
local colorrgba = ColorRGBA(r, g, b)
r | (float) | Red component of the color. |
g | (float) | Green component of the color. |
b | (float) | Blue component of the color. |
Constructor, initializes the color to (r, g, b, a).
local colorrgba = ColorRGBA(r, g, b, a)
r | (float) | Red component of the color. |
g | (float) | Green component of the color. |
b | (float) | Blue component of the color. |
a | (float) | Alpha component of the color. |
Methods of ColorRGBA class.
ColorRGBA.zero() | Returns the color with each element being zero |
ColorRGBA.one() | Returns the color with each element being one |
ColorRGBA.fromSRGB() | Returns a linear color with each element set from a sRGB value |
ColorRGBA.fromSRGB() | Returns a linear color with each element set from a sRGB value |
ColorRGBA:getRed() | Returns the red element of the color |
ColorRGBA:getGreen() | Returns the green element of the color |
ColorRGBA:getBlue() | Returns the blue element of the color |
ColorRGBA:getAlpha() | Returns the alpha element of the color |
ColorRGBA:setRed() | Sets the red element of the color |
ColorRGBA:setGreen() | Sets the green element of the color |
ColorRGBA:setBlue() | Sets the blue element of the color |
ColorRGBA:setAlpha() | Sets the alpha element of the color |
ColorRGBA:hasNan() | Returns true if and only if at least one of the vector values is NaN |
ColorRGBA.lowestValue() | Returns the color with each element having the most negative float value |
ColorRGBA.highestValue() | Returns the color with each element having the most positive float value |
ColorRGBA.nan() | Returns the color with each element being NaN |
ColorRGBA.positiveInfinity() | Returns the color with each element being the positive infinity |
ColorRGBA.negativeInfinity() | Returns the color with each element being the negative infinity |
ColorRGBA.opaqueBlack() | Returns opaque black color (0.0, 0.0, 0.0, 1.0) |
ColorRGBA.transparentBlack() | Returns transparent black color (0.0, 0.0, 0.0, 0.0) |
Returns the color with each element being zero.
(ColorRGBA) | Color with zeroed elements. |
Returns the color with each element being one.
(ColorRGBA) | Color with unit element values. |
Returns a linear color with each element set from a sRGB value.
r | (float) | Red Channel (0-1.0) |
g | (float) | Green Channel (0-1.0) |
b | (float) | Blue Channel (0-1.0) |
a | (float) | Alpha Channel (0-1.0) |
(ColorRGBA) | Color in linear color space. |
Returns a linear color with each element set from a sRGB value.
r | (float) | Red Channel (0-1.0) |
g | (float) | Green Channel (0-1.0) |
b | (float) | Blue Channel (0-1.0) |
(ColorRGBA) | Color in linear color space. |
Returns the red element of the color
(float) | The red element. |
Returns the green element of the color
(float) | The green element. |
Returns the blue element of the color
(float) | The blue element. |
Returns the alpha element of the color
(float) | The alpha element. |
Sets the red element of the color.
value | (float) | The new value of the red element. |
Sets the green element of the color.
value | (float) | The new value of the green element. |
Sets the blue element of the color.
value | (float) | The new value of the blue element. |
Sets the alpha element of the color.
value | (float) | The new value of the alpha element. |
Returns true if and only if at least one of the vector values is NaN.
Returns the color with each element having the most negative float value.
(ColorRGBA) | Color with the lowest possible value. |
Returns the color with each element having the most positive float value.
(ColorRGBA) | Color with the highest possible value. |
Returns the color with each element being NaN.
(ColorRGBA) | Color with NaN elements. |
Returns the color with each element being the positive infinity.
(ColorRGBA) | Color with positive infinity elements. |
Returns the color with each element being the negative infinity.
(ColorRGBA) | Color with negative infinity elements. |
Returns opaque black color (0.0, 0.0, 0.0, 1.0).
(ColorRGBA) | Opaque black. |
Returns transparent black color (0.0, 0.0, 0.0, 0.0).
(ColorRGBA) | Transparent black color. |
ColorRGBA specific standalone functions, which are not a part of the ColorRGBA class.
componentAbs() | Calculates component-wise absolute value for all elements and returns the resulting color |
componentCeil() | Calculates component-wise ceil value for all elements and returns the resulting color |
componentFloor() | Calculates component-wise floor value for all elements and returns the resulting color |
componentRound() | Calculates component-wise rounded value for all elements and returns the resulting color |
componentSqrt() | Calculates component-wise square root all elements and returns the resulting color |
componentWiseMax() | Calculates component-wise maximum for all color elements and returns the resulting color |
componentWiseMin() | Calculates component-wise minimum for all color elements and returns the resulting color |
componentWiseMultiply() | Multiplies component-wise all color elements and returns the resulting color |
componentWiseDivide() | Divides component-wise all color elements and returns the resulting color |
componentWiseRemainder() | Calculates component-wise the remainder for all color elements and returns the resulting color |
componentAdd() | Adds a value to all color elements and returns the resulting color |
componentSubtract() | Subtracts a value from all color elements and returns the resulting color |
dotProduct() | Calculates the dot product of two colors |
sRGBToLinear() | Converts to whole ColorRGBA from sRGB to linear |
linearTosRGB() | Converts whole ColorRGBA color from linear to sRGB |
Calculates component-wise absolute value for all elements and returns the resulting color.
v | (ColorRGBA) | Color input. |
(ColorRGBA) | The result color. |
Calculates component-wise ceil value for all elements and returns the resulting color.
v | (ColorRGBA) | Color input. |
(ColorRGBA) | The result color. |
Calculates component-wise floor value for all elements and returns the resulting color.
v | (ColorRGBA) | Color input. |
(ColorRGBA) | The result color. |
Calculates component-wise rounded value for all elements and returns the resulting color.
v | (ColorRGBA) | Color input. |
(ColorRGBA) | The result color. |
Calculates component-wise square root all elements and returns the resulting color.
v | (ColorRGBA) | Color input. |
(ColorRGBA) | The result color. |
Calculates component-wise maximum for all color elements and returns the resulting color.
v1 | (ColorRGBA) | The first color. |
v2 | (ColorRGBA) | The second color. |
(ColorRGBA) | The result color. |
Calculates component-wise minimum for all color elements and returns the resulting color.
v1 | (ColorRGBA) | The first color. |
v2 | (ColorRGBA) | The second color. |
(ColorRGBA) | The result color. |
Multiplies component-wise all color elements and returns the resulting color.
v1 | (ColorRGBA) | The first color. |
v2 | (ColorRGBA) | The second color. |
(ColorRGBA) | The result color. |
Divides component-wise all color elements and returns the resulting color.
v1 | (ColorRGBA) | The first color. |
v2 | (ColorRGBA) | The second color. |
(ColorRGBA) | The result color. |
Calculates component-wise the remainder for all color elements and returns the resulting color.
v1 | (ColorRGBA) | The first color. |
v2 | (ColorRGBA) | The second color. |
(ColorRGBA) | The result color. |
Adds a value to all color elements and returns the resulting color.
v | (ColorRGBA) | Color. |
scalar | (float) | Value |
(ColorRGBA) | Result color. |
Subtracts a value from all color elements and returns the resulting color.
v | (ColorRGBA) | Color. |
scalar | (float) | Value |
(ColorRGBA) | Result color. |
Calculates the dot product of two colors.
v1 | (ColorRGBA) | The first color. |
v2 | (ColorRGBA) | The second color. |
(float) | The dot product of the colors. |
Converts to whole ColorRGBA from sRGB to linear.
cs | (ColorRGBA) | Color in sRGB format. |
(ColorRGBA) | Color in linear format. |
Converts whole ColorRGBA color from linear to sRGB.
cs | (ColorRGBA) | Color in linear format. |
(ColorRGBA) | Color in sRGB format. |