FormIt C++ API  v23.0.0 (2023.0.0)
WSM::Color Class Reference

Description

The Color class stores an RGBA color value.

#include <Color.h>

Public Member Functions

 Color ()=default
 Constructor. More...
 
 Color (int r, int g, int b, int a)
 Accepts values in the range 0-255. More...
 
 Color (uint8_t r, uint8_t g, uint8_t b, uint8_t a)
 Accepts values in the range 0-255. More...
 
 Color (double r, double g, double b, double a=1.0)
 Accepts values in the range 0-1, defaults alpha to 1.0. More...
 
uint32_t PackRGBA () const
 Pack color channels (RGBA) into a single uint32_t. More...
 
uint32_t PackABGR () const
 Pack color channels (ABGR) into a single uint32_t. More...
 
bool operator== (Color const &r) const
 
bool operator!= (Color const &r) const
 
bool operator< (WSM::Color const &r) const
 

Public Attributes

Color Components

Individual color components are in the range 0 to 255.

uint8_t m_red = 0
 
uint8_t m_green = 0
 
uint8_t m_blue = 0
 
uint8_t m_alpha = 0
 

Constructor & Destructor Documentation

WSM::Color::Color ( )
default

Constructor.

WSM::Color::Color ( int  r,
int  g,
int  b,
int  a 
)
inline

Accepts values in the range 0-255.

WSM::Color::Color ( uint8_t  r,
uint8_t  g,
uint8_t  b,
uint8_t  a 
)
inline

Accepts values in the range 0-255.

WSM::Color::Color ( double  r,
double  g,
double  b,
double  a = 1.0 
)
inline

Accepts values in the range 0-1, defaults alpha to 1.0.

Member Function Documentation

bool WSM::Color::operator!= ( Color const &  r) const
inline
bool WSM::Color::operator< ( WSM::Color const &  r) const
inline
bool WSM::Color::operator== ( Color const &  r) const
inline
uint32_t WSM::Color::PackABGR ( ) const
inline

Pack color channels (ABGR) into a single uint32_t.

uint32_t WSM::Color::PackRGBA ( ) const
inline

Pack color channels (RGBA) into a single uint32_t.

Member Data Documentation

uint8_t WSM::Color::m_alpha = 0
uint8_t WSM::Color::m_blue = 0
uint8_t WSM::Color::m_green = 0
uint8_t WSM::Color::m_red = 0

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