mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 15:38:11 +01:00
Bugfix
This commit is contained in:
parent
c81fd372aa
commit
963e8e9be6
1 changed files with 6 additions and 9 deletions
|
@ -193,25 +193,22 @@ void WaveshareEPaper7C::init_internal_(uint32_t buffer_length) {
|
||||||
}
|
}
|
||||||
uint8_t WaveshareEPaper7C::color_to_hex(Color color) {
|
uint8_t WaveshareEPaper7C::color_to_hex(Color color) {
|
||||||
uint8_t hex_code;
|
uint8_t hex_code;
|
||||||
|
|
||||||
if (color.red > 127) {
|
if (color.red > 127) {
|
||||||
|
if (color.green > 170) {
|
||||||
if (color.blue > 127) {
|
if (color.blue > 127) {
|
||||||
if (color.green > 127) {
|
|
||||||
hex_code = 0x1; // White
|
hex_code = 0x1; // White
|
||||||
} else {
|
} else {
|
||||||
hex_code = 0x5; // Yellow
|
hex_code = 0x5; // Yellow
|
||||||
}
|
}
|
||||||
} else {
|
} else if (color.green > 85) {
|
||||||
if (color.green > 85 && color.green < 170) {
|
|
||||||
hex_code = 0x6; // Orange
|
hex_code = 0x6; // Orange
|
||||||
} else {
|
} else {
|
||||||
hex_code = 0x4; // Red
|
hex_code = 0x4; // Red (or Magenta)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (color.green > 127) {
|
if (color.green > 127) {
|
||||||
if (color.blue > 127) {
|
if (color.blue > 127) {
|
||||||
hex_code = 0x3; // Blue
|
hex_code = 0x3; // Cyan -> Blue
|
||||||
} else {
|
} else {
|
||||||
hex_code = 0x2; // Green
|
hex_code = 0x2; // Green
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue