Section

class Section(val name: String = "", val pixels: List<Int> = listOf(), val parentSectionName: String = "") : SectionManager, SendableData

Represents a section of the full strip and is used by running animations when they need information about the strip or section or when they need to start a subanimation in a subsection

Constructors

Link copied to clipboard
constructor(name: String, pixels: List<Int>, stripManager: LEDStrip, parentSection: SectionManager)
constructor(name: String = "", pixels: List<Int> = listOf(), parentSectionName: String = "")

Properties

Link copied to clipboard
open override val name: String

The string used to identify this section

Link copied to clipboard
open override val numLEDs: Int

The number of pixels in this section

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

A list of the actual colors for the section

Link copied to clipboard

A list of the fade colors for the section

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

A list of the indices of the pixels in this section (range from 0 to numLEDs - 1)

Link copied to clipboard

A list of the prolonged colors for the section

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

A list of all pixels included in this section

Link copied to clipboard

A list of the temporary colors for the section

Link copied to clipboard
open override val sections: MutableMap<String, Section>

The sections managed by this section manager

Link copied to clipboard
open lateinit override var stripManager: LEDStrip

The strip manager this section manager is managing sections for

Link copied to clipboard
open override val subSections: MutableMap<Int, Section>

The subsections managed by this section manager

Functions

Link copied to clipboard

Clear the section (set all pixels to 0)

Link copied to clipboard
open fun createSection(section: Section): Section
open fun createSection(name: String, pixels: List<Int>, parentSectionName: String = ""): Section
open fun createSection(name: String, startPixel: Int, endPixel: Int, parentSectionName: String = ""): Section
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getPhysicalIndex(pixel: Int): Int

Get the appropriate index on the full strip for the specified pixel.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun getSection(sectionName: String): Section
Link copied to clipboard
open fun getSectionOrNull(sectionName: String): Section?
Link copied to clipboard
open fun getSubSection(pixels: List<Int>): Section
open fun getSubSection(startPixel: Int, endPixel: Int): Section
Link copied to clipboard
open fun json(): ByteArray
Link copied to clipboard
open fun jsonString(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Revert a pixel's color (reset its temporary color)

Link copied to clipboard

Revert multiple pixels' color (reset their temporary colors)

Link copied to clipboard

Set a pixel's fade color

Link copied to clipboard
Link copied to clipboard

Set a pixel's prolonged color

Link copied to clipboard

Set a pixel's temporary color

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard