Skip to content

Commit

Permalink
chore(docs): Explain colorspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
reemo3dp committed Mar 14, 2024
1 parent 6f63ec6 commit c715236
Showing 1 changed file with 51 additions and 21 deletions.
72 changes: 51 additions & 21 deletions docs/LED_Effect.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,26 +291,56 @@ Some example palettes:

#### Rainbow

![Preview](./preview_829209814.gif)
![Preview](./preview_3417320710.gif)

```layers
static 0 0 top (1.0, 0.0, 0.0),(0.0, 1.0, 0.0),(0.0, 0.0, 1.0)
```

#### Fire
![Preview](./preview_1232862404.gif)
![Preview](./preview_3330680942.gif)

```layers
static 0 0 top (0.0, 0.0, 0.0),(1.0, 0.0, 0.0),(1.0, 1.0, 0.0),(1.0, 1.0, 1.0)
```

#### Blue Comet
![Preview](./preview_2159877979.gif)
![Preview](./preview_2827746984.gif)

```layers
static 0 0 top (0.8, 1.0, 1.0),(0.0, 0.8, 1.0),(0.0, 0.0, 1.0)
```

### Color Space Parameters **new syntax only**

For every effect that generates a gradient, the colorSpace used for creating the gradient can be specified. This can lead to more natural looking gradients, or avoid white-out transitions between colors.

![Preview](./preview_1862950917.gif)

```layers
static(colorSpace=rgb) top $0000FF, $00FF00, $FFFF00, $FF0000
```


![Preview](./preview_1351037564.gif)

```layers
static(colorSpace=hsl) top $0000FF, $00FF00, $FFFF00, $FF0000
```

![Preview](./preview_4084721591.gif)

```layers
static(colorSpace=lab) top $0000FF, $00FF00, $FFFF00, $FF0000
```

`none` disables mixing and just repeats the palette evenly among the leds.
![Preview](./preview_3091716375.gif)

```layers
static(colorSpace=none) top $0000FF, $00FF00, $FFFF00, $FF0000
```

### Effects

#### Static
Expand All @@ -322,13 +352,13 @@ A single color is displayed and it does not change. If a palette of multiple
colors is provided, colors will be evenly blended along the LEDs based on
difference in hue.

![Preview](./preview_396560817.gif)
![Preview](./preview_3679326809.gif)

```layers
static 1 1 top $FF0000
```

![Preview](./preview_724848644.gif)
![Preview](./preview_547140936.gif)

```layers
static 1 1 top $FF0000, $00FF00, $0000FF
Expand All @@ -344,7 +374,7 @@ LEDs fade through the colors. If a palette of multiple colors is provided, it
will cycle through those colors in the order they are specified in the palette.
The effect rate parameter controls how long it takes to go through all colors.

![Preview](./preview_1655327484.gif)
![Preview](./preview_2292431945.gif)

```layers
linearfade(duration=1) top $FF0000, $00FF00, $0000FF
Expand All @@ -359,7 +389,7 @@ Colors fade in and out. If a palette of multiple colors is provided, it will
cycle through those colors in the order they are specified in the palette.
The effect rate parameter controls how long it takes to "breathe" one time.

![Preview](./preview_3453201676.gif)
![Preview](./preview_695489835.gif)

```layers
breathing(duration=2) top $FF0000, $00FF00
Expand All @@ -373,7 +403,7 @@ breathing(duration=2) top $FF0000, $00FF00
LEDs are turned fully on and fully off based on the effect speed. If a palette
of multiple colors is provided, it will cycle through those colors in order.

![Preview](./preview_2566067626.gif)
![Preview](./preview_3901560142.gif)

```layers
blink(duration=2,onRatio=0.2) top $FF0000, $0000FF
Expand All @@ -389,7 +419,7 @@ of multiple colors is provided, it will cycle through those colors in order. The
effect rate controls how many times per second the lights will strobe. The cutoff
parameter controls the decay rate. A good decay rate is 1.5.

![Preview](./preview_671701181.gif)
![Preview](./preview_3362067017.gif)

```layers
strobe(frequency=0.5,decayRate=0.1) top $FF0000, $0000FF
Expand All @@ -403,7 +433,7 @@ strobe(frequency=0.5,decayRate=0.1) top $FF0000, $0000FF
Random flashes of light with decay along a strip. If a palette is specified,
a random color is chosen from the palette.

![Preview](./preview_3882279444.gif)
![Preview](./preview_2763695045.gif)

```layers
twinkle(probability=0.1,decayRate=0.01) top $00FF00
Expand All @@ -421,19 +451,19 @@ length of the gradient in relation to the chain length. The bigger the value,
the shorter the gradient (e.g. the value 2 means 2 gradients on the length of
the chain)

![Preview](./preview_1812308691.gif)
![Preview](./preview_3226843640.gif)

```layers
gradient(speed=1,count=1) top $FF0000, $00FFFF
```

![Preview](./preview_1540653065.gif)
![Preview](./preview_2162441217.gif)

```layers
gradient(speed=1,count=1,colorSpace=hsl) top $FF0000, $00FFFF
```

![Preview](./preview_4269349779.gif)
![Preview](./preview_997577867.gif)

```layers
gradient(speed=1,count=1,colorSpace=none) top $FF0000, $00FFFF
Expand All @@ -447,7 +477,7 @@ The palette is applied as a recurring pattern on the chain and shifted along the
chain. The effect rate determines the time between the shifts in seconds, the
cutoff determines the amount of LED positions the pattern gets shifted.

![Preview](./preview_189470620.gif)
![Preview](./preview_3280859285.gif)

```layers
pattern(duration=2,shift=1) top $FF0000, $00FFFF
Expand All @@ -463,7 +493,7 @@ by using a negative effect rate value. The palette colors determine the color
of the comet and the tail. The first color of the palette defines the color of
the "head" of the comet and the remaining colors are blended into the "tail"

![Preview](./preview_695340313.gif)
![Preview](./preview_3173539476.gif)

```layers
comet(speed=0.5,tailLength=5,colorSpace=hsl) top $FF6C11, $FF3864, $2DE2E6, $261447, $0D0221, $023788
Expand All @@ -475,7 +505,7 @@ comet(speed=0.5,tailLength=5,colorSpace=hsl) top $FF6C11, $FF3864, $2DE2E6, $261
Palette: Color of "head" and gradient of "tail"
Identical settings as Comet, but with multiple lights chasing each other.

![Preview](./preview_1570801175.gif)
![Preview](./preview_4075602624.gif)

```layers
chase(speed=0.5,tailLength=2,colorSpace=hsl) top $FF6C11, $FF3864, $2DE2E6, $261447, $0D0221, $023788
Expand All @@ -496,7 +526,7 @@ the colors will follow this pattern in reverse until the temperature falls
below the minimum temperature specified in the config. This can be used to
indicate the hotend or bed is in a safe state to touch.

![Preview](./preview_564399861.gif)
![Preview](./preview_1702150654.gif)

```layers
heater(minTemp=10,disableOnceReached=1,heater=heater_bed) top (0.227,0.427,0.705),(0.113,1,0.168),(1,0.85,0.168),(1.00,0.47,0.00),(1,0.392,0.196),(1,0.313,0.156),(1,0.078,0.078),(1,0,0),(1,0,0)
Expand All @@ -510,7 +540,7 @@ The temperature of the configured heater determines the color in a gradient over
the palette. When only one color is defined in the palette, the brightness of
that color is defined by the temperature.

![Preview](./preview_274947729.gif)
![Preview](./preview_3529488879.gif)

```layers
temperature(minTemp=10,maxTemp=60,heater=heater_bed) top (0.227,0.427,0.705),(0.113,1,0.168),(1,0.85,0.168),(1.00,0.47,0.00),(1,0.392,0.196),(1,0.313,0.156),(1,0.078,0.078),(1,0,0),(1,0,0)
Expand All @@ -527,7 +557,7 @@ where it gradually cools. A higher rate of sparking causes a greater amount
of heat to accumulate at the base of the strip resulting a more intense flame.
Changing the rate of cooling results in longer or shorter overall flames.

![Preview](./preview_360211854.gif)
![Preview](./preview_4243066734.gif)

```layers
fire(sparkProbability=45,coolingRate=40) top $FF0000, $AA0000
Expand All @@ -543,7 +573,7 @@ target temperature is reached. If the cutoff parameter is set to 1, the effect
will be disabled once the target temperature is reached, otherwise it will
stay active until the heater is disabled.

![Preview](./preview_1376771172.gif)
![Preview](./preview_500401529.gif)

```layers
heaterfire(minTemp=10,disableOnceReached=0) top $0000FF, $AA0000
Expand Down Expand Up @@ -592,7 +622,7 @@ palette, that is calculated as a gradient over the specified color values.
Exact same configuration as Stepper but instead of reporting stepper position, this
layer reports print progress.

![Preview](./preview_1375634942.gif)
![Preview](./preview_649697196.gif)

```layers
progress(trailingLedCount=2,leadingLedCount=2) top $0000FF, $AA0000
Expand Down

0 comments on commit c715236

Please sign in to comment.