HardFOC Vortex V1 HAL
Unified HAL API for the HardFOC Vortex motor-control platform (ESP32-C6, TMC9660)
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LedColor Struct Reference

Simple RGB colour triplet. More...

#include <LedManager.h>

Public Member Functions

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 Public Member Functions

static constexpr LedColor FromRgb (uint32_t rgb) noexcept
 Unpack from a 24-bit 0xRRGGBB integer.
 

Public Attributes

uint8_t red
 Red channel [0–255].
 
uint8_t green
 Green channel [0–255].
 
uint8_t blue
 Blue channel [0–255].
 

Detailed Description

Simple RGB colour triplet.

Stored as three 8-bit components. Use ToRgb() / FromRgb() to convert to/from a packed 0xRRGGBB integer.

Constructor & Destructor Documentation

◆ LedColor() [1/2]

constexpr LedColor::LedColor ( )
inlineconstexprnoexcept

Default-construct black (0, 0, 0).

Here is the caller graph for this function:

◆ LedColor() [2/2]

constexpr LedColor::LedColor ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)
inlineconstexprnoexcept

Construct from individual R/G/B components.

Parameters
rRed [0–255].
gGreen [0–255].
bBlue [0–255].

Member Function Documentation

◆ FromRgb()

static constexpr LedColor LedColor::FromRgb ( uint32_t  rgb)
inlinestaticconstexprnoexcept

Unpack from a 24-bit 0xRRGGBB integer.

Parameters
rgbPacked 24-bit colour.
Returns
LedColor with extracted R/G/B components.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ToRgb()

constexpr uint32_t LedColor::ToRgb ( ) const
inlineconstexprnoexcept

Pack into a 24-bit 0xRRGGBB integer.

Returns
Packed 24-bit RGB value.
Here is the caller graph for this function:

Member Data Documentation

◆ blue

uint8_t LedColor::blue

Blue channel [0–255].

◆ green

uint8_t LedColor::green

Green channel [0–255].

◆ red

uint8_t LedColor::red

Red channel [0–255].


The documentation for this struct was generated from the following file: