|
cangine
|
RGBA color stored as normalized floating-point components. More...
#include <color.hpp>
Public Member Functions | |
| Color () | |
| Constructs an opaque white color. | |
| Color (float r, float g, float b, float a) | |
| Constructs a color from 0-255 RGB values and an alpha. | |
| Color (float r, float g, float b) | |
| Constructs a fully opaque color from 0-255 RGB values. | |
Public Attributes | |
| float | r = 0 |
| Red channel, normalized to [0, 1]. | |
| float | g = 0 |
| Green channel, normalized to [0, 1]. | |
| float | b = 0 |
| Blue channel, normalized to [0, 1]. | |
| float | a = 0 |
| Alpha channel in [0, 1]. | |
RGBA color stored as normalized floating-point components.
RGB channels are stored in the range [0, 1] (constructors accept 0-255 values and divide by 255), while alpha is stored directly in [0, 1].
|
inline |
Constructs an opaque white color.
|
inline |
Constructs a color from 0-255 RGB values and an alpha.
| r | Red channel in the range [0, 255]. |
| g | Green channel in the range [0, 255]. |
| b | Blue channel in the range [0, 255]. |
| a | Alpha in the range [0, 1] (asserted). |
|
inline |
Constructs a fully opaque color from 0-255 RGB values.
| r | Red channel in the range [0, 255]. |
| g | Green channel in the range [0, 255]. |
| b | Blue channel in the range [0, 255]. |
| float cangine::Color::a = 0 |
Alpha channel in [0, 1].
| float cangine::Color::b = 0 |
Blue channel, normalized to [0, 1].
| float cangine::Color::g = 0 |
Green channel, normalized to [0, 1].
| float cangine::Color::r = 0 |
Red channel, normalized to [0, 1].