|
AvogadroLibs 1.103.0
|
Representation of an RGB color using three floats. More...
#include <avogadro/core/color3f.h>
Public Member Functions | |
| Color3f (float red=0.0, float green=0.0, float blue=0.0) | |
| Color3f (int red, int green, int blue) | |
| void | set (float red, float green, float blue) |
| float | red () const |
| float | green () const |
| float | blue () const |
| float * | data () |
| const float * | data () const |
Protected Attributes | |
| std::array< float, 3 > | m_data |
This class represents a color as three floats ranging from 0.0 to 1.0 specifying the intensity of the red, green and blue components of the color. It is stored in memory as float[3], and so vectors containing this type may be passed directly to OpenGL and other functions as C arrays.
Several convenience functions are provided, the class is written with an emphasis on efficiency and memory layout.
| Color3f | ( | float | red = 0.0, |
| float | green = 0.0, | ||
| float | blue = 0.0 ) |
| Color3f | ( | int | red, |
| int | green, | ||
| int | blue ) |
| void set | ( | float | red, |
| float | green, | ||
| float | blue ) |
| float red | ( | ) | const |
| float green | ( | ) | const |
| float blue | ( | ) | const |
| float * data | ( | ) |
| const float * data | ( | ) | const |
This function is useful when calling OpenGL functions which expect a float * array of size 3.