Saga3D API Documentation
1.0-RC4
|
Class representing a color with four floats. More...
#include <SColor.h>
Public Member Functions | |
SColorf () | |
Default constructor for SColorf. More... | |
SColorf (float r, float g, float b, float a=1.0f) | |
Constructs a color from up to four color values: red, green, blue, and alpha. More... | |
SColorf (SColor c) | |
Constructs a color from 32 bit Color. More... | |
SColor | toSColor () const |
Converts this color to a SColor without floats. More... | |
void | set (float rr, float gg, float bb) |
Sets three color components to new values at once. More... | |
void | set (float aa, float rr, float gg, float bb) |
Sets all four color components to new values at once. More... | |
SColorf | getInterpolated (const SColorf &other, float d) const |
Interpolates the color with a float value to another color. More... | |
SColorf | getInterpolated_quadratic (const SColorf &c1, const SColorf &c2, float d) const |
Returns interpolated color. (quadratic) More... | |
void | setColorComponentValue (std::int32_t index, float value) |
Sets a color component by index. R= 0, G=1, B=2, A=3. More... | |
float | getAlpha () const |
Returns the alpha component of the color in the range 0.0 (transparent) to 1.0 (opaque) More... | |
float | getRed () const |
Returns the red component of the color in the range 0.0 to 1.0. More... | |
float | getGreen () const |
Returns the green component of the color in the range 0.0 to 1.0. More... | |
float | getBlue () const |
Returns the blue component of the color in the range 0.0 to 1.0. More... | |
Public Attributes | |
float | r |
red color component More... | |
float | g |
green color component More... | |
float | b |
blue component More... | |
float | a |
alpha color component More... | |
Class representing a color with four floats.
The color values for red, green, blue and alpha are each stored in a 32 bit floating point variable. So all four values may be between 0.0f and 1.0f. Another, faster way to define colors is using the class SColor, which stores the color values in a single 32 bit integer.
|
inline |
|
inline |
Constructs a color from up to four color values: red, green, blue, and alpha.
r | Red color component. Should be a value between 0.0f meaning no red and 1.0f, meaning full red. |
g | Green color component. Should be a value between 0.0f meaning no green and 1.0f, meaning full green. |
b | Blue color component. Should be a value between 0.0f meaning no blue and 1.0f, meaning full blue. |
a | Alpha color component of the color. The alpha component defines how transparent a color should be. Has to be a value between 0.0f and 1.0f, 1.0f means not transparent (opaque), 0.0f means fully transparent. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Sets all four color components to new values at once.
aa | Alpha component. Should be a value between 0.0f meaning fully transparent and 1.0f, meaning opaque. |
rr | Red color component. Should be a value between 0.0f meaning no red and 1.0f, meaning full red. |
gg | Green color component. Should be a value between 0.0f meaning no green and 1.0f, meaning full green. |
bb | Blue color component. Should be a value between 0.0f meaning no blue and 1.0f, meaning full blue. |
|
inline |
Sets three color components to new values at once.
rr | Red color component. Should be a value between 0.0f meaning no red (=black) and 1.0f, meaning full red. |
gg | Green color component. Should be a value between 0.0f meaning no green (=black) and 1.0f, meaning full green. |
bb | Blue color component. Should be a value between 0.0f meaning no blue (=black) and 1.0f, meaning full blue. |
|
inline |
|
inline |