Lagrange
Color Class Reference

Inherits Vector4f.

Public Types

using BaseType = Eigen::Vector4f
 

Public Member Functions

 Color (const Eigen::Vector4f &color)
 
 Color (const Eigen::Vector3f &rgb, float alpha=1.0f)
 
 Color (const float r, const float g, const float b, const float a)
 
 Color (const float r, const float g, const float b)
 
 Color (const float v)
 
template<typename Derived >
 Color (const Eigen::MatrixBase< Derived > &p)
 
template<typename Derived >
Coloroperator= (const Eigen::MatrixBase< Derived > &p)
 
float & r ()
 
float r () const
 
float & g ()
 
float g () const
 
float & b ()
 
float b () const
 
float & a ()
 
float a () const
 
Eigen::Vector3f to_vec3 () const
 
Eigen::Vector4f to_vec4 () const
 
Color operator+ (const float v) const
 
Color operator- (const float v) const
 
Color operator/ (const float v) const
 
Color operator* (const float v) const
 
Color operator+ (const Color c) const
 
Color operator- (const Color c) const
 
void clamp ()
 Clamps the color.
 
Color clamped () const
 
bool is_white ()
 
bool is_black ()
 
float distance (const Color c) const
 
int to_integer () const
 

Static Public Member Functions

static Color empty ()
 
static Color zero ()
 
static Color black ()
 
static Color white ()
 
static Color red ()
 
static Color green ()
 
static Color blue ()
 
static Color cyan ()
 
static Color yellow ()
 
static Color purple ()
 
template<typename URBG >
static const Color random_from (URBG &&urbg)
 Get a random color. More...
 
static const Color random (int i)
 
static Color integer_to_color (int i)
 

Member Function Documentation

◆ random_from()

static const Color random_from ( URBG &&  urbg)
inlinestatic

Get a random color.

Parameters
[in,out]urbgC++11 random number generator.
Template Parameters
URBGRNG type.
Returns
Color.

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