|
ESPHome 2026.11.0b6
|
Which byte of an addressable LED's data carries each colour. More...
#include <channel_colors.h>
Public Member Functions | |
| constexpr | ChannelColors () |
| constexpr | ChannelColors (uint8_t r_offset, uint8_t g_offset, uint8_t b_offset) |
| constexpr | ChannelColors (uint8_t r_offset, uint8_t g_offset, uint8_t b_offset, uint8_t w_offset) |
| bool | has_white () const |
| size_t | bytes_per_led () const |
| Color | get (const uint8_t *color_data, int32_t index) const ESPHOME_ALWAYS_INLINE |
| uint8_t | get_channel (const uint8_t *color_data, int32_t index, uint8_t channel) const |
| void | set (uint8_t *color_data, int32_t index, Color color) const |
| void | set_channel (uint8_t *color_data, int32_t index, uint8_t channel, uint8_t value) const |
| const char * | to_string (char *buf) const |
| Write the order back out as text, e.g. | |
| LightTraits | traits () const |
| Colour modes of a strip with this channel order. | |
Data Fields | ||
| union { | ||
| struct { | ||
| uint8_t r | ||
| uint8_t g | ||
| uint8_t b | ||
| uint8_t w | ||
| } | ||
| uint8_t raw [4] | ||
| }; | ||
Static Public Attributes | |
| static constexpr uint8_t | NO_WHITE = 0xFF |
Value of w for an RGB LED strip that uses 3 bytes per led. | |
| static constexpr uint8_t | RESERVED_WHITE = 0xFE |
Value of w for an RGB LED strip that uses 4 bytes per led where the 4th byte is reserved. | |
Which byte of an addressable LED's data carries each colour.
Built from a configuration string such as "GRB" or "WRGB": every field holds the position that colour occupies in the bytes the strip expects. w is NO_WHITE when the strip has no separate white channel.
Definition at line 18 of file channel_colors.h.
|
inlineconstexpr |
Definition at line 24 of file channel_colors.h.
|
inlineconstexpr |
Definition at line 25 of file channel_colors.h.
|
inlineconstexpr |
Definition at line 27 of file channel_colors.h.
|
inline |
Definition at line 42 of file channel_colors.h.
|
inline |
Definition at line 44 of file channel_colors.h.
|
inline |
Definition at line 51 of file channel_colors.h.
|
inline |
Definition at line 40 of file channel_colors.h.
|
inline |
Definition at line 56 of file channel_colors.h.
|
inline |
Definition at line 70 of file channel_colors.h.
|
inline |
Write the order back out as text, e.g.
"GRBW".
buf must have room for at least 5 characters. Returns buf so the result can be passed straight to a log call.
Definition at line 80 of file channel_colors.h.
|
inline |
Colour modes of a strip with this channel order.
Definition at line 93 of file channel_colors.h.
| union { ... } esphome::light::ChannelColors |
| uint8_t esphome::light::ChannelColors::b |
Definition at line 34 of file channel_colors.h.
| uint8_t esphome::light::ChannelColors::g |
Definition at line 33 of file channel_colors.h.
|
staticconstexpr |
Value of w for an RGB LED strip that uses 3 bytes per led.
Definition at line 20 of file channel_colors.h.
| uint8_t esphome::light::ChannelColors::r |
Definition at line 32 of file channel_colors.h.
| uint8_t esphome::light::ChannelColors::raw[4] |
Definition at line 37 of file channel_colors.h.
|
staticconstexpr |
Value of w for an RGB LED strip that uses 4 bytes per led where the 4th byte is reserved.
Definition at line 22 of file channel_colors.h.
| uint8_t esphome::light::ChannelColors::w |
Definition at line 35 of file channel_colors.h.