MeshLib Documentation
Loading...
Searching...
No Matches
MR::Color Struct Reference

#include <MRColor.h>

Public Member Functions

constexpr Color () noexcept
 
 Color (NoInit) noexcept
 
constexpr Color (int r, int g, int b, int a=255) noexcept
 
constexpr Color (float r, float g, float b, float a=1) noexcept
 
constexpr unsigned int getUInt32 () const noexcept
 
template<typename T >
constexpr Color (const Vector3< T > &vec) noexcept
 
template<typename T >
constexpr Color (const Vector4< T > &vec) noexcept
 
template<typename T >
constexpr operator Vector4< T > () const noexcept
 
const uint8_t & operator[] (int e) const
 
uint8_t & operator[] (int e)
 
Coloroperator+= (const Color &other)
 
Coloroperator-= (const Color &other)
 
Coloroperator*= (float m)
 
Coloroperator/= (float m)
 
constexpr Color scaledAlpha (float m) const noexcept
 

Static Public Member Functions

static constexpr Color white () noexcept
 
static constexpr Color black () noexcept
 
static constexpr Color gray () noexcept
 
static constexpr Color red () noexcept
 
static constexpr Color green () noexcept
 
static constexpr Color blue () noexcept
 
static constexpr Color yellow () noexcept
 
static constexpr Color brown () noexcept
 
static constexpr Color purple () noexcept
 
static constexpr Color transparent () noexcept
 
template<typename T >
static constexpr uint8_t valToUint8 (T val) noexcept
 

Public Attributes

uint8_t r
 
uint8_t g
 
uint8_t b
 
uint8_t a
 

Constructor & Destructor Documentation

◆ Color() [1/6]

MR::Color::Color ( )
inlineconstexprnoexcept

◆ Color() [2/6]

MR::Color::Color ( NoInit )
inlineexplicitnoexcept

◆ Color() [3/6]

MR::Color::Color ( int r,
int g,
int b,
int a = 255 )
inlineconstexprnoexcept

◆ Color() [4/6]

MR::Color::Color ( float r,
float g,
float b,
float a = 1 )
inlineconstexprnoexcept

◆ Color() [5/6]

template<typename T >
MR::Color::Color ( const Vector3< T > & vec)
inlineexplicitconstexprnoexcept

◆ Color() [6/6]

template<typename T >
MR::Color::Color ( const Vector4< T > & vec)
inlineexplicitconstexprnoexcept

Member Function Documentation

◆ black()

static constexpr Color MR::Color::black ( )
inlinestaticconstexprnoexcept

◆ blue()

static constexpr Color MR::Color::blue ( )
inlinestaticconstexprnoexcept

◆ brown()

static constexpr Color MR::Color::brown ( )
inlinestaticconstexprnoexcept

◆ getUInt32()

unsigned int MR::Color::getUInt32 ( ) const
inlineconstexprnoexcept

◆ gray()

static constexpr Color MR::Color::gray ( )
inlinestaticconstexprnoexcept

◆ green()

static constexpr Color MR::Color::green ( )
inlinestaticconstexprnoexcept

◆ operator Vector4< T >()

template<typename T >
MR::Color::operator Vector4< T > ( ) const
inlineexplicitconstexprnoexcept

◆ operator*=()

Color & MR::Color::operator*= ( float m)
inline

◆ operator+=()

Color & MR::Color::operator+= ( const Color & other)
inline

◆ operator-=()

Color & MR::Color::operator-= ( const Color & other)
inline

◆ operator/=()

Color & MR::Color::operator/= ( float m)
inline

◆ operator[]() [1/2]

uint8_t & MR::Color::operator[] ( int e)
inline

◆ operator[]() [2/2]

const uint8_t & MR::Color::operator[] ( int e) const
inline

◆ purple()

static constexpr Color MR::Color::purple ( )
inlinestaticconstexprnoexcept

◆ red()

static constexpr Color MR::Color::red ( )
inlinestaticconstexprnoexcept

◆ scaledAlpha()

Color MR::Color::scaledAlpha ( float m) const
inlineconstexprnoexcept

◆ transparent()

static constexpr Color MR::Color::transparent ( )
inlinestaticconstexprnoexcept

◆ valToUint8()

template<typename T >
static constexpr uint8_t MR::Color::valToUint8 ( T val)
inlinestaticconstexprnoexcept

◆ white()

static constexpr Color MR::Color::white ( )
inlinestaticconstexprnoexcept

◆ yellow()

static constexpr Color MR::Color::yellow ( )
inlinestaticconstexprnoexcept

Member Data Documentation

◆ a

uint8_t MR::Color::a

◆ b

uint8_t MR::Color::b

◆ g

uint8_t MR::Color::g

◆ r

uint8_t MR::Color::r

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