Documentation syntax highlighting
This commit is contained in:
parent
8405fbc92f
commit
c2e34b4688
|
@ -20,7 +20,7 @@ Homie Schild Firmware
|
||||||
|
|
||||||
## Color
|
## Color
|
||||||
To convert RGB value use the following bash code:
|
To convert RGB value use the following bash code:
|
||||||
```bash
|
```shell
|
||||||
function rgbToColor {
|
function rgbToColor {
|
||||||
echo $(( $(($1<<16)) + $(($2<<8)) + $(($3)) ));
|
echo $(( $(($1<<16)) + $(($2<<8)) + $(($3)) ));
|
||||||
}
|
}
|
||||||
|
@ -30,16 +30,17 @@ function colorToRGB {
|
||||||
echo "Green: $(($1>>8&0xff))"
|
echo "Green: $(($1>>8&0xff))"
|
||||||
echo "Blue: $(($1&0xff))"
|
echo "Blue: $(($1&0xff))"
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
#### Example
|
#### Example
|
||||||
RGB Value to color uint32_t
|
RGB Value to color uint32_t
|
||||||
```bash
|
```shell
|
||||||
bash$ rgbToColor 155 230 32
|
bash$ rgbToColor 155 230 32
|
||||||
10216992
|
10216992
|
||||||
bash$
|
bash$
|
||||||
```
|
```
|
||||||
uint32_t to RGB values
|
uint32_t to RGB values
|
||||||
```bash
|
```shell
|
||||||
bash$ colorToRGB 10216992
|
bash$ colorToRGB 10216992
|
||||||
Red: 155
|
Red: 155
|
||||||
Green: 230
|
Green: 230
|
||||||
|
|
Loading…
Reference in New Issue