Color Container
A class for storing colors that can be used in animations. This can store a variable number of colors (stored as 24-bit Int
s).
Behavior when Int
s outside the range 0..0xFFFFFF
are added is undefined.
Constructors
Properties
Functions
Compares this ColorContainer
against another ColorContainer
or an Int
. If other
is a ColorContainer
, the colors parameters are compared. If other
is a PreparedColorContainer
, the colors parameter is compared to the originalColors
parameter. If other
is an Int
, the color parameter is compared to the Int
.
Get the color in colors at the specified index. Checks if index
is a valid index of colors
and if so, returns the color stored there, if not, returns 0
(black).
Get multiple colors from colors. Accepts a variable number of arguments (a single argument will be caught by the get()
operator above). If no indices are provided, this will return an empty list. If an index is not a valid index in colors
, 0
is added to the list. The returned list contains the colors in the order specified.
Get multiple colors from colors. If an index in the range is not a valid index in colors
, 0
is added to the list.
Replaces all colors in ColorContainer.colors with a grayscaled version of themselves.
Replaces the colors at the indices in the specified ranges with a grayscaled version of themselves.
Replaces the colors at the specified indices with a grayscaled version of themselves.
Returns a new ColorContainer with the same colors as this instance, but grayscaled.
Returns a new ColorContainer with the same colors as this instance, grayscaled, but only including the ranges of indices specified.
Returns a new ColorContainer with the same colors as this instance, grayscaled, but only including the indices specified.
Returns a new ColorContainer with the same colors as this instance, but inverted.
Returns a new ColorContainer with the same colors as this instance, inverted, but only including the ranges of indices specified.
Returns a new ColorContainer with the same colors as this instance, inverted, but only including the indices specified.
Replaces all colors in ColorContainer.colors with their inverse.
Replaces the colors at the indices in the specified ranges with their inverse
Replaces the colors at the specified indices with their inverse.
Report whether colors
is empty
Report whether colors
is not empty
Adds a color at the end of colors.
Prepare these colors for use with a LED strip by creating a collection of colors that blend between multiple colors along the 'strip'.
Operator overload that returns a new ColorContainer containing the inverse of the colors in this ColorContainer.