Skip to content

Commit 2fc3775

Browse files
authored
Update palettes CSS
1 parent 199bdce commit 2fc3775

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

docs/Berry_Addressable-LED.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ set_bri|`set_bri(bri:0..100) -> nil` sets the brightness for the color, defaults
152152

153153
Palette|Description
154154
:---|:---
155-
`animate.PALETTE_STANDARD_TAG`|Standard palette cycling through 7 colors<br><div style='width:300px;height:30px;background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00EE00 42.9%,#0000FF 57.1%,#4B00FF 71.4%,#FF82FF 85.7%,#FF0000 100.0%);'></div>
156-
`animate.PALETTE_STANDARD_VAL`|Same palette described as values<br>
157-
`animate.PALETTE_RAINBOW_WHITE`|Cycle through 8 colors (including white) and keep colors steady<br>
158-
`animate.PALETTE_SATURATED_TAG`|Cycle through 7 saturated colors<br>
155+
`animate.PALETTE_STANDARD_TAG`|Standard palette cycling through 7 colors<br><div style='width:300px;height:30px;background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00FF00 42.9%,#0000FF 57.1%,#FF00FF 71.4%,#FFFFFF 85.7%,#FF0000 100.0%);'></div>
156+
`animate.PALETTE_STANDARD_VAL`|Same palette described as values<br><div style='width:300px;height:30px;background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.1%,#FFFF00 28.6%,#00FF00 43.1%,#0000FF 57.3%,#FF00FF 71.8%,#FFFFFF 85.9%,#FF0000 100.0%);'></div>
157+
`animate.PALETTE_RAINBOW_WHITE`|Cycle through 8 colors (including white) and keep colors steady<br><div style='width:300px;height:30px;background:linear-gradient(to right,#FF0000 0.0%,#FF0000 8.9%,#FFA500 14.3%,#FFA500 23.2%,#FFFF00 28.6%,#FFFF00 37.5%,#00FF00 42.9%,#00FF00 51.8%,#0000FF 57.1%,#0000FF 66.1%,#FF00FF 71.4%,#FF00FF 80.4%,#FFFFFF 85.7%,#FFFFFF 94.6%,#FF0000 100.0%);'></div>
158+
`animate.PALETTE_SATURATED_TAG`|Cycle through 7 saturated colors<br><div style='width:300px;height:30px;background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00FF00 42.9%,#0000FF 57.1%,#FF00FF 71.4%,#FFFFFF 85.7%,#FF0000 100.0%);'></div>
159159

160160
Palettes can be specified as a `bytes()` object of via `comptr` if they are solidified in Flash.
161161

@@ -171,7 +171,7 @@ This format makes it easier to adjust the transition time between colors
171171

172172
Example:
173173

174-
```
174+
```berry
175175
var PALETTE_SATURATED_TAG = bytes(
176176
"40" "FF0000" # red
177177
"40" "FFA500" # orange
@@ -195,7 +195,7 @@ This format is useful to use palettes that represent a color range.
195195

196196
Example:
197197

198-
```
198+
```berry
199199
var PALETTE_STANDARD_VAL = bytes(
200200
"00" "FF0000" # red
201201
"24" "FFA500" # orange
@@ -208,6 +208,14 @@ var PALETTE_STANDARD_VAL = bytes(
208208
)
209209
```
210210

211+
Note: you can generate a CSS linear-gradient of a palette with the following code:
212+
213+
```berry
214+
import animate
215+
print(animate.palette.to_css_gradient(animate.PALETTE_STANDARD_TAG))
216+
# background:linear-gradient(to right,#FF0000 0.0%,#FFA500 14.3%,#FFFF00 28.6%,#00FF00 42.9%,#0000FF 57.1%,#FF00FF 71.4%,#FFFFFF 85.7%,#FF0000 100.0%);
217+
```
218+
211219
## Advanced features
212220

213221
### Hardware `RMT` channels

0 commit comments

Comments
 (0)