gKit3
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members

representation d'une couleur (rgba) transparente ou opaque. More...

#include <color.h>

Public Member Functions

 Color ()
 constructeur par defaut.
 
 Color (const float _r, const float _g, const float _b, const float _a=1.f)
 
 Color (const float _value)
 
 Color (const Color &color, const float alpha)
 cree une couleur avec les memes composantes que color, mais remplace sa composante alpha (color.r, color.g, color.b, alpha).
 
float power () const
 
float max () const
 

Public Attributes

float r
 
float g
 
float b
 
float a
 

Detailed Description

representation d'une couleur (rgba) transparente ou opaque.

Definition at line 13 of file color.h.

Constructor & Destructor Documentation

◆ Color() [1/4]

Color::Color ( )
inline

constructeur par defaut.

Definition at line 16 of file color.h.

16: r(0.f), g(0.f), b(0.f), a(1.f) {}

◆ Color() [2/4]

Color::Color ( const float  _r,
const float  _g,
const float  _b,
const float  _a = 1.f 
)
inlineexplicit

Definition at line 17 of file color.h.

17: r(_r), g(_g), b(_b), a(_a) {}

◆ Color() [3/4]

Color::Color ( const float  _value)
inlineexplicit

Definition at line 18 of file color.h.

18: r(_value), g(_value), b(_value), a(1.f) {}

◆ Color() [4/4]

Color::Color ( const Color color,
const float  alpha 
)
inline

cree une couleur avec les memes composantes que color, mais remplace sa composante alpha (color.r, color.g, color.b, alpha).

Definition at line 21 of file color.h.

21: r(color.r), g(color.g), b(color.b), a(alpha) {} // remplace alpha.

Member Function Documentation

◆ power()

float Color::power ( ) const

Definition at line 8 of file color.cpp.

9{
10 return (r+g+b) / 3;
11}

◆ max()

float Color::max ( ) const

Definition at line 13 of file color.cpp.

14{
15 return std::max(r, std::max(g, std::max(b, float(0))));
16}

Member Data Documentation

◆ r

float Color::r

Definition at line 26 of file color.h.

◆ g

float Color::g

Definition at line 26 of file color.h.

◆ b

float Color::b

Definition at line 26 of file color.h.

◆ a

float Color::a

Definition at line 26 of file color.h.


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