SensESP 3.4.1-alpha
Universal Signal K sensor toolkit ESP32
Loading...
Searching...
No Matches
sensesp::CRGB Struct Reference

Minimal RGB color struct. More...

#include <sensesp/system/crgb.h>

Public Member Functions

constexpr CRGB () noexcept
 Default constructor - initializes to black.
 
constexpr CRGB (uint8_t ir, uint8_t ig, uint8_t ib) noexcept
 RGB constructor.
 
constexpr CRGB (const CRGB &rhs) noexcept=default
 Copy constructor.
 
CRGBoperator= (const CRGB &rhs) noexcept=default
 Assignment operator.
 
constexpr CRGB operator- (const CRGB &rhs) const noexcept
 Binary subtraction operator with saturation.
 

Public Attributes

uint8_t r
 
uint8_t g
 
uint8_t b
 

Static Public Attributes

static const CRGB Black {0, 0, 0}
 
static const CRGB Red {255, 0, 0}
 
static const CRGB Yellow {255, 255, 0}
 
static const CRGB Blue {0, 0, 255}
 

Detailed Description

Minimal RGB color struct.

This is a lightweight replacement for FastLED's CRGB struct, implementing only the features used by SensESP's LED blinker system.

Definition at line 59 of file crgb.h.

Constructor & Destructor Documentation

◆ CRGB() [1/3]

constexpr sensesp::CRGB::CRGB ( )
inlineconstexprnoexcept

Default constructor - initializes to black.

Definition at line 65 of file crgb.h.

Here is the caller graph for this function:

◆ CRGB() [2/3]

constexpr sensesp::CRGB::CRGB ( uint8_t  ir,
uint8_t  ig,
uint8_t  ib 
)
inlineconstexprnoexcept

RGB constructor.

Definition at line 68 of file crgb.h.

◆ CRGB() [3/3]

constexpr sensesp::CRGB::CRGB ( const CRGB rhs)
constexprdefaultnoexcept

Copy constructor.

Member Function Documentation

◆ operator-()

constexpr CRGB sensesp::CRGB::operator- ( const CRGB rhs) const
inlineconstexprnoexcept

Binary subtraction operator with saturation.

Subtracts each channel component-wise, saturating at 0. Used for color inversion: CRGB(255,255,255) - color

Definition at line 83 of file crgb.h.

Here is the call graph for this function:

◆ operator=()

CRGB & sensesp::CRGB::operator= ( const CRGB rhs)
defaultnoexcept

Assignment operator.

Member Data Documentation

◆ b

uint8_t sensesp::CRGB::b

Definition at line 62 of file crgb.h.

◆ Black

constexpr CRGB sensesp::CRGB::Black {0, 0, 0}
inlinestaticconstexpr

Definition at line 89 of file crgb.h.

◆ Blue

constexpr CRGB sensesp::CRGB::Blue {0, 0, 255}
inlinestaticconstexpr

Definition at line 92 of file crgb.h.

◆ g

uint8_t sensesp::CRGB::g

Definition at line 61 of file crgb.h.

◆ r

uint8_t sensesp::CRGB::r

Definition at line 60 of file crgb.h.

◆ Red

constexpr CRGB sensesp::CRGB::Red {255, 0, 0}
inlinestaticconstexpr

Definition at line 90 of file crgb.h.

◆ Yellow

constexpr CRGB sensesp::CRGB::Yellow {255, 255, 0}
inlinestaticconstexpr

Definition at line 91 of file crgb.h.


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