blink1-lib  1.0.0
blink1_lib::RGB Struct Reference

#include <RGB.hpp>

Public Member Functions

 RGB (const std::uint8_t r, const std::uint8_t g, const std::uint8_t b) noexcept
 
 RGB () noexcept=default
 
bool operator== (const RGB &other) const noexcept
 
bool operator!= (const RGB &other) const noexcept
 

Public Attributes

std::uint8_t r {0}
 
std::uint8_t g {0}
 
std::uint8_t b {0}
 

Friends

std::ostream & operator<< (std::ostream &os, const RGB &rgb)
 

Detailed Description

Represents a color

Constructor & Destructor Documentation

◆ RGB() [1/2]

blink1_lib::RGB::RGB ( const std::uint8_t  r,
const std::uint8_t  g,
const std::uint8_t  b 
)
noexcept
Parameters
rRed value
gGreen value
bBlue value

◆ RGB() [2/2]

blink1_lib::RGB::RGB ( )
defaultnoexcept

Default constructor

Intializes all values to 0

Member Function Documentation

◆ operator!=()

bool blink1_lib::RGB::operator!= ( const RGB other) const
noexcept

Inequality operator

Parameters
otherObject to compare to
Returns
true if the objects are not equal, false otherwise

◆ operator==()

bool blink1_lib::RGB::operator== ( const RGB other) const
noexcept

Equality operator

Parameters
otherObject to compare to
Returns
true if the objects are equal, false otherwise

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const RGB rgb 
)
friend

Output operator

Parameters
osOutput stream
rgbRGB object to output

Member Data Documentation

◆ b

std::uint8_t blink1_lib::RGB::b {0}

Blue component

◆ g

std::uint8_t blink1_lib::RGB::g {0}

Green component

◆ r

std::uint8_t blink1_lib::RGB::r {0}

Red component


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