scenepic 1.1.0
3D Visualization Made Easy
Public Types | Public Member Functions | Static Public Member Functions | List of all members
scenepic::Color Class Reference

Class for representing color values. More...

#include <color.h>

Inheritance diagram for scenepic::Color:

Public Types

typedef Eigen::Vector3f Base
 

Public Member Functions

 Color (void)
 Empty constructor. More...
 
 Color (Eigen::Index rows, Eigen::Index cols)
 Needed for pybind. More...
 
template<typename OtherDerived >
 Color (const Eigen::MatrixBase< OtherDerived > &other)
 Constructor which allows construction of Colors from Eigen expressions. More...
 
template<typename OtherDerived >
Coloroperator= (const Eigen::MatrixBase< OtherDerived > &other)
 Constructor which allows Eigen assignments to Color. More...
 
 Color (const Scalar &red, const Scalar &green, const Scalar &blue)
 Constructor. More...
 
std::string to_html_hex () const
 Convert the color to an HTML hex color string. More...
 
Scalar r () const
 The red value [0,1]. More...
 
Scalar g () const
 The green value [0,1]. More...
 
Scalar b () const
 The blue value [0,1]. More...
 
std::uint8_t R () const
 The red value [0,255]. More...
 
std::uint8_t G () const
 The green value [0,255]. More...
 
std::uint8_t B () const
 The blue value [0,255]. More...
 
Scalar & r ()
 Reference to the red value [0,1]. More...
 
Scalar & g ()
 Reference to the green value [0,1]. More...
 
Scalar & b ()
 Reference to the blue value [0,1]. More...
 
std::string to_string () const
 Represent the color as a string. More...
 
bool is_none () const
 Whether this is a "no color" instance. More...
 

Static Public Member Functions

static Color from_bytes (std::uint8_t red, std::uint8_t green, std::uint8_t blue)
 Construct a color object from byte values. More...
 
static const Color None ()
 Constant value indicating "no color". More...
 

Detailed Description

Class for representing color values.

Member Typedef Documentation

◆ Base

typedef Eigen::Vector3f scenepic::Color::Base

Constructor & Destructor Documentation

◆ Color() [1/4]

scenepic::Color::Color ( void  )
inline

Empty constructor.

◆ Color() [2/4]

scenepic::Color::Color ( Eigen::Index  rows,
Eigen::Index  cols 
)
inline

Needed for pybind.

◆ Color() [3/4]

template<typename OtherDerived >
scenepic::Color::Color ( const Eigen::MatrixBase< OtherDerived > &  other)
inline

Constructor which allows construction of Colors from Eigen expressions.

◆ Color() [4/4]

scenepic::Color::Color ( const Scalar &  red,
const Scalar &  green,
const Scalar &  blue 
)

Constructor.

Parameters
redRed channel [0,1]
greenGreen channel [0,1]
blueBlue channel [0,1]

Member Function Documentation

◆ b() [1/2]

Scalar & scenepic::Color::b ( )

Reference to the blue value [0,1].

◆ b() [2/2]

Scalar scenepic::Color::b ( ) const

The blue value [0,1].

◆ B()

std::uint8_t scenepic::Color::B ( ) const

The blue value [0,255].

◆ from_bytes()

static Color scenepic::Color::from_bytes ( std::uint8_t  red,
std::uint8_t  green,
std::uint8_t  blue 
)
static

Construct a color object from byte values.

Parameters
redRed channel
greenGreen channel
blueBlue channel
Returns
a valid color object

◆ g() [1/2]

Scalar & scenepic::Color::g ( )

Reference to the green value [0,1].

◆ g() [2/2]

Scalar scenepic::Color::g ( ) const

The green value [0,1].

◆ G()

std::uint8_t scenepic::Color::G ( ) const

The green value [0,255].

◆ is_none()

bool scenepic::Color::is_none ( ) const

Whether this is a "no color" instance.

◆ None()

static const Color scenepic::Color::None ( )
static

Constant value indicating "no color".

◆ operator=()

template<typename OtherDerived >
Color & scenepic::Color::operator= ( const Eigen::MatrixBase< OtherDerived > &  other)
inline

Constructor which allows Eigen assignments to Color.

◆ r() [1/2]

Scalar & scenepic::Color::r ( )

Reference to the red value [0,1].

◆ r() [2/2]

Scalar scenepic::Color::r ( ) const

The red value [0,1].

◆ R()

std::uint8_t scenepic::Color::R ( ) const

The red value [0,255].

◆ to_html_hex()

std::string scenepic::Color::to_html_hex ( ) const

Convert the color to an HTML hex color string.

◆ to_string()

std::string scenepic::Color::to_string ( ) const

Represent the color as a string.


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