Class SpotColor
Wrapper over Spot's color class.
A color's values may be read or written through its h, s, l, and a properties.
NOTE Spot color support is still experimental.
Metamethods
- SpotColor:__add ()
-
Metamethod.
The right-hand argument may be a SpotColor or a number (implicitly, a color with four equal values).
Any errors are propagated.
Returns:
-
SpotColor
The sum of the two colors.
- SpotColor:__div ()
-
Metamethod.
The right-hand argument may be a SpotColor or a number (implicitly, a color with four equal values).
Any errors are propagated.
Returns:
-
SpotColor
The quotient of the two colors.
- SpotColor:__mul ()
-
Metamethod.
The right-hand argument may be a SpotColor or a number (implicitly, a color with four equal values).
Any errors are propagated.
Returns:
-
SpotColor
The product of the two colors.
- SpotColor:__sub ()
-
Metamethod.
The right-hand argument may be a SpotColor or a number (implicitly, a color with four equal values).
Any errors are propagated.
Returns:
-
SpotColor
The difference of the two colors.
Methods
- SpotColor:add_mutate (color)
-
Modify this color by adding another color to it.
Parameters:
- color SpotColor Color to add.
Returns:
-
true, indicating success.
Or
- false, meaning failure.
- string Error message.
- SpotColor:clamp ()
-
Create a new color with this color's components, clamped to [0, 1].
Returns:
-
SpotColor
New color.
Or
- nil, meaning failure.
- string Error message.
- SpotColor:clone ()
-
Create a clone of this color.
Returns:
-
SpotColor
New color.
Or
- nil, meaning failure.
- string Error message.
- SpotColor:div_mutate (color)
-
Modify this color by dividing it by another color.
Parameters:
- color SpotColor Color to divide by.
Returns:
-
true, indicating success.
Or
- false, meaning failure.
- string Error message.
- SpotColor:mul_mutate (color)
-
Modify this color by multiplying it by another color.
Parameters:
- color SpotColor Color to multiply by.
Returns:
-
true, indicating success.
Or
- false, meaning failure.
- string Error message.
- SpotColor:premultiply ()
-
Create a new color with alpha premultiplied through this color's components.
Returns:
-
SpotColor
New color.
Or
- nil, meaning failure.
- string Error message.
- SpotColor:sub_mutate (color)
-
Modify this color by subtracting another color from it.
Parameters:
- color SpotColor Color to subtract.
Returns:
-
true, indicating success.
Or
- false, meaning failure.
- string Error message.
- SpotColor:to_rgba ()
-
Create a new color with this color's components converted to RGBA values.
Returns:
-
SpotColor
New color.
Or
- nil, meaning failure.
- string Error message.
- SpotColor:unpremultiply ()
-
Create a new color with alpha unpremultiplied from this color's components.
Returns:
-
SpotColor
New color.
Or
- nil, meaning failure.
- string Error message.