Simple RGB colour triplet.
More...
#include <LedManager.h>
|
| constexpr | LedColor () noexcept |
| | Default-construct black (0, 0, 0).
|
| |
| constexpr | LedColor (uint8_t r, uint8_t g, uint8_t b) noexcept |
| | Construct from individual R/G/B components.
|
| |
| constexpr uint32_t | ToRgb () const noexcept |
| | Pack into a 24-bit 0xRRGGBB integer.
|
| |
|
| static constexpr LedColor | FromRgb (uint32_t rgb) noexcept |
| | Unpack from a 24-bit 0xRRGGBB integer.
|
| |
|
| uint8_t | red |
| | Red channel [0–255].
|
| |
| uint8_t | green |
| | Green channel [0–255].
|
| |
| uint8_t | blue |
| | Blue channel [0–255].
|
| |
Simple RGB colour triplet.
Stored as three 8-bit components. Use ToRgb() / FromRgb() to convert to/from a packed 0xRRGGBB integer.
◆ LedColor() [1/2]
| constexpr LedColor::LedColor |
( |
| ) |
|
|
inlineconstexprnoexcept |
Default-construct black (0, 0, 0).
◆ LedColor() [2/2]
| constexpr LedColor::LedColor |
( |
uint8_t |
r, |
|
|
uint8_t |
g, |
|
|
uint8_t |
b |
|
) |
| |
|
inlineconstexprnoexcept |
Construct from individual R/G/B components.
- Parameters
-
| r | Red [0–255]. |
| g | Green [0–255]. |
| b | Blue [0–255]. |
◆ FromRgb()
| static constexpr LedColor LedColor::FromRgb |
( |
uint32_t |
rgb | ) |
|
|
inlinestaticconstexprnoexcept |
Unpack from a 24-bit 0xRRGGBB integer.
- Parameters
-
- Returns
- LedColor with extracted R/G/B components.
◆ ToRgb()
| constexpr uint32_t LedColor::ToRgb |
( |
| ) |
const |
|
inlineconstexprnoexcept |
Pack into a 24-bit 0xRRGGBB integer.
- Returns
- Packed 24-bit RGB value.
◆ blue
◆ green
◆ red
The documentation for this struct was generated from the following file: