FastLED 3.6.0
Loading...
Searching...
No Matches
Pixel Data Types (CRGB/CHSV)

Detailed Description

Structs that hold pixel color data.

Classes

struct  CHSV
 Representation of an HSV pixel (hue, saturation, value (aka brightness)). More...
 
struct  CRGB
 Representation of an RGB pixel (Red, Green, Blue) More...
 

Enumerations

enum  HSVHue {
  HUE_RED = 0 , HUE_ORANGE = 32 , HUE_YELLOW = 64 , HUE_GREEN = 96 ,
  HUE_AQUA = 128 , HUE_BLUE = 160 , HUE_PURPLE = 192 , HUE_PINK = 224
}
 Pre-defined hue values for CHSV objects. More...
 
enum  EOrder {
  RGB =0012 , RBG =0021 , GRB =0102 , GBR =0120 ,
  BRG =0201 , BGR =0210
}
 RGB color channel orderings, used when instantiating controllers to determine what order the controller should send data out in. More...
 

Functions

void hsv2rgb_rainbow (const CHSV &hsv, CRGB &rgb)
 Forward declaration of hsv2rgb_rainbow here, to avoid circular dependencies.
 
bool operator== (const CRGB &lhs, const CRGB &rhs)
 Check if two CRGB objects have the same color data.
 
bool operator!= (const CRGB &lhs, const CRGB &rhs)
 Check if two CRGB objects do not have the same color data.
 
bool operator== (const CHSV &lhs, const CHSV &rhs)
 Check if two CHSV objects have the same color data.
 
bool operator!= (const CHSV &lhs, const CHSV &rhs)
 Check if two CHSV objects do not have the same color data.
 
bool operator< (const CRGB &lhs, const CRGB &rhs)
 Check if the sum of the color channels in one CRGB object is less than another.
 
bool operator> (const CRGB &lhs, const CRGB &rhs)
 Check if the sum of the color channels in one CRGB object is greater than another.
 
bool operator>= (const CRGB &lhs, const CRGB &rhs)
 Check if the sum of the color channels in one CRGB object is greater than or equal to another.
 
bool operator<= (const CRGB &lhs, const CRGB &rhs)
 Check if the sum of the color channels in one CRGB object is less than or equal to another.
 
CRGB operator+ (const CRGB &p1, const CRGB &p2)
 Add one CRGB to another, saturating at 0xFF for each channel.
 
CRGB operator- (const CRGB &p1, const CRGB &p2)
 Subtract one CRGB from another, saturating at 0x00 for each channel.
 
CRGB operator* (const CRGB &p1, uint8_t d)
 Multiply each of the channels by a constant, saturating each channel at 0xFF.
 
CRGB operator/ (const CRGB &p1, uint8_t d)
 Divide each of the channels by a constant.
 
CRGB operator& (const CRGB &p1, const CRGB &p2)
 Combine two CRGB objects, taking the smallest value of each channel.
 
CRGB operator| (const CRGB &p1, const CRGB &p2)
 Combine two CRGB objects, taking the largest value of each channel.
 
CRGB operator% (const CRGB &p1, uint8_t d)
 Scale using CRGB::nscale8_video()
 

Enumeration Type Documentation

◆ EOrder

enum EOrder

RGB color channel orderings, used when instantiating controllers to determine what order the controller should send data out in.

The default ordering is RGB. Within this enum, the red channel is 0, the green channel is 1, and the blue chanel is 2.

Enumerator
RGB 

Red, Green, Blue (0012)

RBG 

Red, Blue, Green (0021)

GRB 

Green, Red, Blue (0102)

GBR 

Green, Blue, Red (0120)

BRG 

Blue, Red, Green (0201)

BGR 

Blue, Green, Red (0210)

Definition at line 956 of file pixeltypes.h.

◆ HSVHue

enum HSVHue

Pre-defined hue values for CHSV objects.

Enumerator
HUE_RED 

Red (0°)

HUE_ORANGE 

Orange (45°)

HUE_YELLOW 

Yellow (90°)

HUE_GREEN 

Green (135°)

HUE_AQUA 

Aqua (180°)

HUE_BLUE 

Blue (225°)

HUE_PURPLE 

Purple (270°)

HUE_PINK 

Pink (315°)

Definition at line 108 of file pixeltypes.h.

Function Documentation

◆ hsv2rgb_rainbow()

void hsv2rgb_rainbow ( const CHSV hsv,
CRGB rgb 
)

Forward declaration of hsv2rgb_rainbow here, to avoid circular dependencies.

Definition at line 251 of file hsv2rgb.cpp.

◆ operator!=() [1/2]

bool operator!= ( const CHSV lhs,
const CHSV rhs 
)
inline

Check if two CHSV objects do not have the same color data.

Definition at line 845 of file pixeltypes.h.

◆ operator!=() [2/2]

bool operator!= ( const CRGB lhs,
const CRGB rhs 
)
inline

Check if two CRGB objects do not have the same color data.

Definition at line 833 of file pixeltypes.h.

◆ operator%()

CRGB operator% ( const CRGB p1,
uint8_t  d 
)
inline

Scale using CRGB::nscale8_video()

Definition at line 942 of file pixeltypes.h.

◆ operator&()

CRGB operator& ( const CRGB p1,
const CRGB p2 
)
inline

Combine two CRGB objects, taking the smallest value of each channel.

Definition at line 924 of file pixeltypes.h.

◆ operator*()

CRGB operator* ( const CRGB p1,
uint8_t  d 
)
inline

Multiply each of the channels by a constant, saturating each channel at 0xFF.

Definition at line 907 of file pixeltypes.h.

◆ operator+()

CRGB operator+ ( const CRGB p1,
const CRGB p2 
)
inline

Add one CRGB to another, saturating at 0xFF for each channel.

Definition at line 889 of file pixeltypes.h.

◆ operator-()

CRGB operator- ( const CRGB p1,
const CRGB p2 
)
inline

Subtract one CRGB from another, saturating at 0x00 for each channel.

Definition at line 898 of file pixeltypes.h.

◆ operator/()

CRGB operator/ ( const CRGB p1,
uint8_t  d 
)
inline

Divide each of the channels by a constant.

Definition at line 916 of file pixeltypes.h.

◆ operator<()

bool operator< ( const CRGB lhs,
const CRGB rhs 
)
inline

Check if the sum of the color channels in one CRGB object is less than another.

Definition at line 851 of file pixeltypes.h.

◆ operator<=()

bool operator<= ( const CRGB lhs,
const CRGB rhs 
)
inline

Check if the sum of the color channels in one CRGB object is less than or equal to another.

Definition at line 878 of file pixeltypes.h.

◆ operator==() [1/2]

bool operator== ( const CHSV lhs,
const CHSV rhs 
)
inline

Check if two CHSV objects have the same color data.

Definition at line 839 of file pixeltypes.h.

◆ operator==() [2/2]

bool operator== ( const CRGB lhs,
const CRGB rhs 
)
inline

Check if two CRGB objects have the same color data.

Definition at line 827 of file pixeltypes.h.

◆ operator>()

bool operator> ( const CRGB lhs,
const CRGB rhs 
)
inline

Check if the sum of the color channels in one CRGB object is greater than another.

Definition at line 860 of file pixeltypes.h.

◆ operator>=()

bool operator>= ( const CRGB lhs,
const CRGB rhs 
)
inline

Check if the sum of the color channels in one CRGB object is greater than or equal to another.

Definition at line 869 of file pixeltypes.h.

◆ operator|()

CRGB operator| ( const CRGB p1,
const CRGB p2 
)
inline

Combine two CRGB objects, taking the largest value of each channel.

Definition at line 933 of file pixeltypes.h.