PreparedColorContainer

class PreparedColorContainer(val colors: List<Int>, val originalColors: List<Int> = listOf()) : ColorContainerInterface

A set of colors ready for use with a LED strip. Colors blend from one to the next along the length of the strip.

See also

Constructors

Link copied to clipboard
constructor(colors: List<Int>, originalColors: List<Int> = listOf())

Properties

Link copied to clipboard
open override val color: Int

Override for color that only returns 0

Link copied to clipboard
open override val colors: List<Int>

The List of colors in this PreparedColorContainer

Link copied to clipboard

The colors that were used to prepare this PreparedColorContainer

Link copied to clipboard
val size: Int

Functions

Link copied to clipboard
operator fun contains(value: Int): Boolean

Checks if the specified color is in colors

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean

Compares this PreparedColorContainer against another ColorContainer or an Int. If other is a ColorContainer, the originalColors parameter is compared to the originalColors parameter. If other is a PreparedColorContainer, the originalColors parameters are compared. If other is an Int, the color parameter is compared to the Int.

Link copied to clipboard
operator fun get(index: Int): 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).

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard

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.

Link copied to clipboard

Report whether colors is empty

Link copied to clipboard

Report whether colors is not empty

Link copied to clipboard
operator fun iterator(): Iterator<Int>
Link copied to clipboard
open override fun prepare(numLEDs: Int): PreparedColorContainer

If this PreparedColorContainer is the correct size, return this instance, otherwise a new instance of the correct size

Link copied to clipboard

Create a PreparedColorContainer with the same colors as this PreparedColorContainer, shifted by offset. The color at index 0 will be moved to index offset. Negative offsets and offsets that are larger than the size of colors are supported.

Link copied to clipboard
fun ColorContainerInterface.shuffledWithIndices(): List<<Error class: unknown class><Int, Int>>
Link copied to clipboard
open override fun toColorContainer(): ColorContainer
Link copied to clipboard
Link copied to clipboard
open override fun toString(): String

Create a string representation of this PreparedColorContainer. The hexadecimal representation of each color in colors is listed in comma delimited format, between brackets [&].

Link copied to clipboard

Operator overload that returns a new ColorContainer containing the inverse of the colors in this ColorContainer.