Euphoria
eu::Rgb Struct Reference

#include <rgb.h>

Public Member Functions

 Rgb (float red, float green, float blue)
 
 Rgb (float gray)
 
 Rgb (NamedColor color)
 
float get_length () const
 
float get_length_squared () const
 
float calc_luminance () const
 
void operator+= (const Rgb &rhs)
 
void operator-= (const Rgb &rhs)
 
void operator/= (float rhs)
 
void operator*= (const Rgb &rhs)
 

Static Public Member Functions

static Rgb from_hex (unsigned int hex)
 

Public Attributes

float r
 
float g
 
float b
 

Detailed Description

Definition at line 61 of file rgb.h.

Constructor & Destructor Documentation

◆ Rgb() [1/3]

eu::Rgb::Rgb ( float  red,
float  green,
float  blue 
)

Definition at line 16 of file rgb.cc.

◆ Rgb() [2/3]

eu::Rgb::Rgb ( float  gray)
explicit

Definition at line 18 of file rgb.cc.

◆ Rgb() [3/3]

eu::Rgb::Rgb ( NamedColor  color)

Definition at line 20 of file rgb.cc.

Member Function Documentation

◆ calc_luminance()

float eu::Rgb::calc_luminance ( ) const

Definition at line 46 of file rgb.cc.

◆ from_hex()

Rgb eu::Rgb::from_hex ( unsigned int  hex)
static

Definition at line 23 of file rgb.cc.

◆ get_length()

float eu::Rgb::get_length ( ) const

Definition at line 33 of file rgb.cc.

◆ get_length_squared()

float eu::Rgb::get_length_squared ( ) const

Definition at line 39 of file rgb.cc.

◆ operator*=()

void eu::Rgb::operator*= ( const Rgb rhs)

Definition at line 71 of file rgb.cc.

◆ operator+=()

void eu::Rgb::operator+= ( const Rgb rhs)

Definition at line 53 of file rgb.cc.

◆ operator-=()

void eu::Rgb::operator-= ( const Rgb rhs)

Definition at line 62 of file rgb.cc.

◆ operator/=()

void eu::Rgb::operator/= ( float  rhs)

Definition at line 80 of file rgb.cc.

Member Data Documentation

◆ b

float eu::Rgb::b

Definition at line 65 of file rgb.h.

◆ g

float eu::Rgb::g

Definition at line 64 of file rgb.h.

◆ r

float eu::Rgb::r

Definition at line 63 of file rgb.h.


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