SensESP 3.2.2
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 58 of file crgb.h.

Constructor & Destructor Documentation

◆ CRGB() [1/3]

sensesp::CRGB::CRGB ( )
inlineconstexprnoexcept

Default constructor - initializes to black.

Definition at line 64 of file crgb.h.

Here is the caller graph for this function:

◆ CRGB() [2/3]

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

RGB constructor.

Definition at line 67 of file crgb.h.

◆ CRGB() [3/3]

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

Copy constructor.

Here is the call graph for this function:

Member Function Documentation

◆ operator-()

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 82 of file crgb.h.

Here is the call graph for this function:

◆ operator=()

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

Assignment operator.

Here is the call graph for this function:

Member Data Documentation

◆ b

uint8_t sensesp::CRGB::b

Definition at line 61 of file crgb.h.

◆ Black

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

Definition at line 88 of file crgb.h.

◆ Blue

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

Definition at line 91 of file crgb.h.

◆ g

uint8_t sensesp::CRGB::g

Definition at line 60 of file crgb.h.

◆ r

uint8_t sensesp::CRGB::r

Definition at line 59 of file crgb.h.

◆ Red

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

Definition at line 89 of file crgb.h.

◆ Yellow

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

Definition at line 90 of file crgb.h.


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