libNeon
Loading...
Searching...
No Matches
neo::rgb Struct Reference

#include <color.hpp>

Public Member Functions

 rgb ()=default
 
 rgb (std::uint32_t rgb_)
 
 rgb (std::uint8_t r_, std::uint8_t g_, std::uint8_t b_)
 
rgbupdate (maybe_update< std::uint8_t > r_, maybe_update< std::uint8_t > g_, maybe_update< std::uint8_t > b_)
 
rgb update (maybe_update< std::uint8_t > r_, maybe_update< std::uint8_t > g_, maybe_update< std::uint8_t > b_) const
 
rgbshift (maybe_update< signed > dr, maybe_update< signed > dg, maybe_update< signed > db)
 
rgb shift (maybe_update< signed > dr, maybe_update< signed > dg, maybe_update< signed > db) const
 
rgbshift (rgb delta, bool negate=false)
 
rgb shift (rgb delta, bool negate=false) const
 
rgbblend (rgb target, float factor)
 
rgb blend (rgb target, float factor) const
 
hsv to_hsv () const
 
std::array< float, 3 > to_linear_rgb () const
 
std::string to_string () const
 

Static Public Member Functions

static rgb from_linear_rgb (std::array< float, 3 > const &linear_rgb)
 

Public Attributes

std::uint8_t r = 0
 
std::uint8_t g = 0
 
std::uint8_t b = 0
 

Detailed Description

The values are expressed in sRGB color space.

Constructor & Destructor Documentation

◆ rgb() [1/3]

neo::rgb::rgb ( )
default

◆ rgb() [2/3]

neo::rgb::rgb ( std::uint32_t  rgb_)
inlineexplicit

◆ rgb() [3/3]

neo::rgb::rgb ( std::uint8_t  r_,
std::uint8_t  g_,
std::uint8_t  b_ 
)
inline

Member Function Documentation

◆ blend() [1/2]

rgb & neo::rgb::blend ( rgb  target,
float  factor 
)

◆ blend() [2/2]

rgb neo::rgb::blend ( rgb  target,
float  factor 
) const
inline

◆ from_linear_rgb()

rgb neo::rgb::from_linear_rgb ( std::array< float, 3 > const &  linear_rgb)
static

◆ shift() [1/4]

rgb & neo::rgb::shift ( maybe_update< signed >  dr,
maybe_update< signed >  dg,
maybe_update< signed >  db 
)

◆ shift() [2/4]

rgb neo::rgb::shift ( maybe_update< signed >  dr,
maybe_update< signed >  dg,
maybe_update< signed >  db 
) const
inline

◆ shift() [3/4]

rgb & neo::rgb::shift ( rgb  delta,
bool  negate = false 
)
inline

◆ shift() [4/4]

rgb neo::rgb::shift ( rgb  delta,
bool  negate = false 
) const
inline

◆ to_hsv()

hsv neo::rgb::to_hsv ( ) const

◆ to_linear_rgb()

std::array< float, 3 > neo::rgb::to_linear_rgb ( ) const

◆ to_string()

std::string neo::rgb::to_string ( ) const

◆ update() [1/2]

rgb & neo::rgb::update ( maybe_update< std::uint8_t >  r_,
maybe_update< std::uint8_t >  g_,
maybe_update< std::uint8_t >  b_ 
)

◆ update() [2/2]

rgb neo::rgb::update ( maybe_update< std::uint8_t >  r_,
maybe_update< std::uint8_t >  g_,
maybe_update< std::uint8_t >  b_ 
) const
inline

Member Data Documentation

◆ b

std::uint8_t neo::rgb::b = 0

◆ g

std::uint8_t neo::rgb::g = 0

◆ r

std::uint8_t neo::rgb::r = 0

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