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:

Returns:

    true, indicating success.

Or

  1. false, meaning failure.
  2. string Error message.
SpotColor:clamp ()
Create a new color with this color's components, clamped to [0, 1].

Returns:

    SpotColor New color.

Or

  1. nil, meaning failure.
  2. string Error message.
SpotColor:clone ()
Create a clone of this color.

Returns:

    SpotColor New color.

Or

  1. nil, meaning failure.
  2. string Error message.
SpotColor:div_mutate (color)
Modify this color by dividing it by another color.

Parameters:

Returns:

    true, indicating success.

Or

  1. false, meaning failure.
  2. string Error message.
SpotColor:mul_mutate (color)
Modify this color by multiplying it by another color.

Parameters:

Returns:

    true, indicating success.

Or

  1. false, meaning failure.
  2. string Error message.
SpotColor:premultiply ()
Create a new color with alpha premultiplied through this color's components.

Returns:

    SpotColor New color.

Or

  1. nil, meaning failure.
  2. string Error message.
SpotColor:sub_mutate (color)
Modify this color by subtracting another color from it.

Parameters:

Returns:

    true, indicating success.

Or

  1. false, meaning failure.
  2. string Error message.
SpotColor:to_rgba ()
Create a new color with this color's components converted to RGBA values.

Returns:

    SpotColor New color.

Or

  1. nil, meaning failure.
  2. string Error message.
SpotColor:unpremultiply ()
Create a new color with alpha unpremultiplied from this color's components.

Returns:

    SpotColor New color.

Or

  1. nil, meaning failure.
  2. string Error message.
generated by LDoc 1.4.6 Last updated 2018-09-03 18:10:24