FastLED 3.9.4
Loading...
Searching...
No Matches
CHSV Struct Reference

Detailed Description

Representation of an HSV pixel (hue, saturation, value (aka brightness)).

Examples
AnalogOutput.ino, ColorPalette.ino, Noise.ino, OctoWS2811Demo.ino, ParallelOutputDemo.ino, RGBSetDemo.ino, SmartMatrix.ino, and XYMatrix.ino.

Definition at line 11 of file chsv.h.

#include <chsv.h>

Public Member Functions

uint8_t & operator[] (uint8_t x)
 Array access operator to index into the CHSV object.
 
const uint8_t & operator[] (uint8_t x) const
 Array access operator to index into the CHSV object.
 
constexpr CHSV ()
 Default constructor.
 
constexpr CHSV (uint8_t ih, uint8_t is, uint8_t iv)
 Allow construction from hue, saturation, and value.
 
constexpr CHSV (const CHSV &rhs) noexcept
 Allow copy construction.
 
CHSVoperator= (const CHSV &rhs)=default
 Allow copy construction.
 
CHSVsetHSV (uint8_t ih, uint8_t is, uint8_t iv)
 Assign new HSV values.
 

Public Attributes

union { 
 
   struct { 
 
      union { 
 
         uint8_t   hue 
 Color hue. More...
 
         uint8_t   h 
 Color hue. More...
 
      }  
 
      union { 
 
         uint8_t   saturation 
 Color saturation. More...
 
         uint8_t   sat 
 Color saturation. More...
 
         uint8_t   s 
 Color saturation. More...
 
      }  
 
      union { 
 
         uint8_t   value 
 Color value (brightness). More...
 
         uint8_t   val 
 Color value (brightness). More...
 
         uint8_t   v 
 Color value (brightness). More...
 
      }  
 
   }  
 
   uint8_t   raw [3] 
 Access the hue, saturation, and value data as an array. More...
 
};  
 

Constructor & Destructor Documentation

◆ CHSV() [1/3]

CHSV::CHSV ( )
inlineconstexpr

Default constructor.

Warning
Default values are UNITIALIZED!

Definition at line 60 of file chsv.h.

◆ CHSV() [2/3]

CHSV::CHSV ( uint8_t ih,
uint8_t is,
uint8_t iv )
inlineconstexpr

Allow construction from hue, saturation, and value.

Parameters
ihinput hue
isinput saturation
ivinput value

Definition at line 66 of file chsv.h.

◆ CHSV() [3/3]

CHSV::CHSV ( const CHSV & rhs)
inlineconstexprnoexcept

Allow copy construction.

Definition at line 72 of file chsv.h.

Member Function Documentation

◆ operator[]() [1/2]

uint8_t & CHSV::operator[] ( uint8_t x)
inline

Array access operator to index into the CHSV object.

Parameters
xthe index to retrieve (0-2)
Returns
the CHSV::raw value for the given index

Definition at line 47 of file chsv.h.

◆ operator[]() [2/2]

const uint8_t & CHSV::operator[] ( uint8_t x) const
inline

Array access operator to index into the CHSV object.

Parameters
xthe index to retrieve (0-2)
Returns
the CHSV::raw value for the given index

Definition at line 53 of file chsv.h.

◆ setHSV()

CHSV & CHSV::setHSV ( uint8_t ih,
uint8_t is,
uint8_t iv )
inline

Assign new HSV values.

Parameters
ihinput hue
isinput saturation
ivinput value
Returns
reference to the CHSV object

Definition at line 82 of file chsv.h.

Member Data Documentation

◆ h

uint8_t CHSV::h

Color hue.

This is an 8-bit value representing an angle around the color wheel. Where 0 is 0°, and 255 is 358°.

Definition at line 19 of file chsv.h.

◆ hue

uint8_t CHSV::hue

Color hue.

This is an 8-bit value representing an angle around the color wheel. Where 0 is 0°, and 255 is 358°.

Definition at line 18 of file chsv.h.

◆ raw

uint8_t CHSV::raw[3]

Access the hue, saturation, and value data as an array.

Where:

  • raw[0] is the hue
  • raw[1] is the saturation
  • raw[2] is the value

Definition at line 41 of file chsv.h.

◆ s

uint8_t CHSV::s

Color saturation.

This is an 8-bit value representing a percentage.

Definition at line 26 of file chsv.h.

◆ sat

uint8_t CHSV::sat

Color saturation.

This is an 8-bit value representing a percentage.

Definition at line 25 of file chsv.h.

◆ saturation

uint8_t CHSV::saturation

Color saturation.

This is an 8-bit value representing a percentage.

Definition at line 24 of file chsv.h.

◆ v

uint8_t CHSV::v

Color value (brightness).

This is an 8-bit value representing a percentage.

Definition at line 33 of file chsv.h.

◆ val

uint8_t CHSV::val

Color value (brightness).

This is an 8-bit value representing a percentage.

Definition at line 32 of file chsv.h.

◆ value

uint8_t CHSV::value

Color value (brightness).

This is an 8-bit value representing a percentage.

Definition at line 31 of file chsv.h.


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