Light Effects API

Light effects are a number of customizable animations that can be displayed to a LightRegion. Light effects are activated in response to different Actions.

In addition, light effects can be stacked on top of each other. When you have regions that overlap each other (e.g. using the same LEDs for brakes and indicators), you can specify which effects have priority over others using the optional layer parameter for each effect.

Colors must be provided as one of the following:

  • HTML hex string (#RRGGBB)

  • random - Random color

  • rainbow - Rainbow color (cycles each render step)

Setting a duration or speed of 0 will stop the effect from animating

Transparent

Skips rendering this layer (useful when you want to preserve colors from another layer)

0,<layer>

Parameter

Type

Description

layer

uint8_t

(Optional) Layer

Off

Sets all lights in the region to off

1,<layer>

Parameter

Type

Description

layer

uint8_t

(Optional) Layer

Color

Sets all LEDs in a region to the provided color

2,<color>,<layer>

Parameter

Type

Description

color

string

Background color

layer

uint8_t

(Optional) Layer

Blinks the entire strip between two colors at a set duration

3,<first>,<second>,<duration>,<layer>

Parameter

Type

Description

first

string

First blink color

second

string

Second blink color

duration

unsigned long long

Time for each color (ms)

layer

uint8_t

(Optional) Layer

Alternate

Repeats two pixel colors along a region. Colors swap at a set speed

4,<first>,<second>,<duration>,<layer>

Parameter

Type

Description

first

string

First

second

string

Second blink color

duration

unsigned long long

Time between alternations (ms)

layer

uint8_t

(Optional) Layer

ColorWipe

Progressively wipes the Region from one color to the next over the duration

5,<first>,<second>,<duration>,<layer>

Parameter

Type

Description

first

string

First blink color

second

string

Second blink color

duration

unsigned long long

Time between wipes (ms)

layer

uint8_t

(Optional) Layer

Breathe

iDevice standby style breathing animation (fixed speed)

6,<first>,<second>,<layer>

Parameter

Type

Description

first

string

First breathe color

second

string

Second breathe color

layer

uint8_t

(Optional) Layer

Fade

Fade between two colors cyclically

7,<first>,<second>,<duration>,<layer>

Parameter

Type

Description

first

string

First blink color

second

string

Second blink color

duration

unsigned long long

Fade duration (ms)

layer

uint8_t

(Optional) Layer

Scan

Moves a single pixel back and forth across a lighting region

8,<background>,<scanner>,<duration>,<layer>

Parameter

Type

Description

background

string

Background color

scanner

string

Scan pixel color

duration

unsigned long long

Time between colors (ms)

layer

uint8_t

(Optional) Layer

Rainbow

Cycles the entire region through a rainbow spectrum of colors at a set speed

9,<speed>,<layer>

Parameter

Type

Description

speed

unsigned long long

Color change time (ms)

layer

uint8_t

(Optional) Layer

Rainbow Cycle

Sets the region to the rainbow spectrum and moves the colors along the region at a set speed

10,<speed>,<layer>

Parameter

Type

Description

speed

unsigned long long

Cycle speed (ms)

layer

uint8_t

(Optional) Layer

Color Chase

Three color marquee chase lights (inspired by the Adafruit Neopixel library)

11,<first>,<second>,<third>,<speed>,<layer>

Parameter

Type

Description

first

string

First chase color

second

string

Second chase color

third

string

Third chase color

speed

unsigned long long

Update speed (ms)

layer

uint8_t

(Optional) Layer

Theater Chase

Theater marquee style chase lights (inspired by the Adafruit Neopixel library)

12,<color>,<speed>,<layer>

Parameter

Type

Description

color

string

Marquee color

speed

unsigned long long

Update speed (ms)

layer

uint8_t

(Optional) Layer

Twinkle

Randomly twinkles a second color on top of a background color

13,<background>,<twinkle>,<duration>,<layer>

Parameter

Type

Description

background

string

Background color

twinkle

string

Twinkle color

duration

unsigned long long

Twinkle speed (ms)

layer

uint8_t

(Optional) Layer

Sparkle

Randomly sparkles a color along the region on top of a background color

14,<background>,<sparkle>,<duration>,<layer>

Parameter

Type

Description

background

string

Background color

sparkle

string

Sparkle color

speed

unsigned long long

Sparkle speed (ms)

layer

uint8_t

(Optional) Layer