Raylib C++
1.0.0
Encapsulates the raylib library
|
Encapsulation of the raylib Color. More...
#include <RlColor.hpp>
Public Member Functions | |
RlColor (Color color) | |
Construct an RlColor from Raylib's Color. More... | |
RlColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a) | |
Construct an RlColor from RGBA values. More... | |
RlColor (std::uint32_t color) | |
Construct the color from 32-bit unsigned integer. More... | |
RlColor (const Vector4f &normalizedColor) | |
Get color from normalized values [0..1]. More... | |
RlColor (float hue, float saturation, float value) | |
Create a RlColor from HSV values, hue [0..360], saturation/value [0..1]. More... | |
void | alpha (float alpha) |
Apply alpha to the color, alpha goes from 0.0f to 1.0f. More... | |
Vector3f | toHSV () |
Returns HSV values for a Color, hue [0..360], saturation/value [0..1]. More... | |
std::uint32_t | toInteger () const |
Retrieve the color as a 32-bit unsigned integer (hexadecimal) More... | |
Vector4f | normalize () const |
Normalize the color to [0..1]. More... | |
void | alphaBlend (const RlColor &src, const RlColor &tint) |
Blend src into this color with tint. More... | |
const Color & | getColor () const |
Get the Raylib's Color. More... | |
const unsigned char & | getRed () const |
Get the red value. More... | |
const unsigned char & | getGreen () const |
Get the green value. More... | |
const unsigned char & | getBlue () const |
Get the blue value. More... | |
const unsigned char & | getAlpha () const |
Get the alpha value. More... | |
void | setColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a) |
Set the rgba color. More... | |
RlColor & | setRed (unsigned char r) |
Set the red value. More... | |
RlColor & | setGreen (unsigned char g) |
Set the green value. More... | |
RlColor & | setBlue (unsigned char b) |
Set the blue value. More... | |
RlColor & | setAlpha (unsigned char a) |
Set the alpha value. More... | |
void | setColor (const Color &color) |
Set the color from the raylib color. More... | |
bool | operator== (const RlColor &other) const |
Check equality between two colors. More... | |
bool | operator!= (const RlColor &other) const |
Check inequality between two colors. More... | |
RlColor & | operator- (unsigned char value) |
Remove the value to all the color components. More... | |
RlColor & | operator+ (unsigned char value) |
Add the value to all the color components. More... | |
RlColor & | operator-= (unsigned char value) |
Remove the value to all the color components. More... | |
RlColor & | operator+= (unsigned char value) |
Add the value to all the color components. More... | |
Static Public Attributes | |
static const RlColor | LightGray = raylib::RlColor(200, 200, 200, 255) |
static const RlColor | Gray = raylib::RlColor(130, 130, 130, 255) |
static const RlColor | DarkGray = raylib::RlColor(80, 80, 80, 255) |
static const RlColor | Yellow = raylib::RlColor(253, 249, 0, 255) |
static const RlColor | Gold = raylib::RlColor(255, 203, 0, 255) |
static const RlColor | Orange = raylib::RlColor(255, 161, 0, 255) |
static const RlColor | Pink = raylib::RlColor(255, 109, 194, 255) |
static const RlColor | Red = raylib::RlColor(230, 41, 55, 255) |
static const RlColor | Maroon = raylib::RlColor(190, 33, 55, 255) |
static const RlColor | Green = raylib::RlColor(0, 228, 48, 255) |
static const RlColor | Lime = raylib::RlColor(0, 158, 47, 255) |
static const RlColor | DarkGreen = raylib::RlColor(0, 117, 44, 255) |
static const RlColor | SkyBlue = raylib::RlColor(102, 191, 255, 255) |
static const RlColor | Blue = raylib::RlColor(0, 121, 241, 255) |
static const RlColor | DarkBlue = raylib::RlColor(0, 82, 172, 255) |
static const RlColor | Purple = raylib::RlColor(200, 122, 255, 255) |
static const RlColor | Violet = raylib::RlColor(135, 60, 190, 255) |
static const RlColor | DarkPurple = raylib::RlColor(112, 31, 126, 255) |
static const RlColor | Beige = raylib::RlColor(211, 176, 131, 255) |
static const RlColor | Brown = raylib::RlColor(127, 106, 79, 255) |
static const RlColor | DarkBrown = raylib::RlColor(76, 63, 47, 255) |
static const RlColor | White = raylib::RlColor(255, 255, 255, 255) |
static const RlColor | Black = raylib::RlColor(0, 0, 0, 255) |
static const RlColor | Transparent = raylib::RlColor(0, 0, 0, 0) |
static const RlColor | Magenta = raylib::RlColor(255, 0, 255, 255) |
static const RlColor | RayWhite = raylib::RlColor(245, 245, 245, 255) |
Encapsulation of the raylib Color.
|
explicit |
Construct an RlColor from Raylib's Color.
color | the Raylib's Color |
|
explicit |
Construct an RlColor from RGBA values.
r | the red value |
g | the green value |
b | the blue value |
a | the alpha value |
|
explicit |
Construct the color from 32-bit unsigned integer.
color | Number containing the RGBA components (in that order) |
|
explicit |
Get color from normalized values [0..1].
normalizedColor | the normalized color |
|
explicit |
Create a RlColor from HSV values, hue [0..360], saturation/value [0..1].
hue | to convert |
saturation | to convert |
value | to convert |
void raylib::RlColor::alpha | ( | float | alpha | ) |
Apply alpha to the color, alpha goes from 0.0f to 1.0f.
alpha | to apply |
Blend src into this color with tint.
src | the color to apply alpha to |
tint | the color to apply |
const unsigned char & raylib::RlColor::getAlpha | ( | ) | const |
Get the alpha value.
const unsigned char & raylib::RlColor::getBlue | ( | ) | const |
Get the blue value.
const Color & raylib::RlColor::getColor | ( | ) | const |
Get the Raylib's Color.
const unsigned char & raylib::RlColor::getGreen | ( | ) | const |
Get the green value.
const unsigned char & raylib::RlColor::getRed | ( | ) | const |
Get the red value.
Vector4f raylib::RlColor::normalize | ( | ) | const |
Normalize the color to [0..1].
bool raylib::RlColor::operator!= | ( | const RlColor & | other | ) | const |
Check inequality between two colors.
other | another color |
RlColor & raylib::RlColor::operator+ | ( | unsigned char | value | ) |
Add the value to all the color components.
value | the value to add |
RlColor & raylib::RlColor::operator+= | ( | unsigned char | value | ) |
Add the value to all the color components.
value | the value to add |
raylib::RlColor & raylib::RlColor::operator- | ( | unsigned char | value | ) |
Remove the value to all the color components.
value | the value to remove |
RlColor & raylib::RlColor::operator-= | ( | unsigned char | value | ) |
Remove the value to all the color components.
value | the value to remove |
bool raylib::RlColor::operator== | ( | const RlColor & | other | ) | const |
Check equality between two colors.
other | another color |
raylib::RlColor & raylib::RlColor::setAlpha | ( | unsigned char | a | ) |
Set the alpha value.
a | the alpha value |
raylib::RlColor & raylib::RlColor::setBlue | ( | unsigned char | b | ) |
Set the blue value.
b | the blue value |
void raylib::RlColor::setColor | ( | const Color & | color | ) |
Set the color from the raylib color.
color | the raylib color |
void raylib::RlColor::setColor | ( | unsigned char | r, |
unsigned char | g, | ||
unsigned char | b, | ||
unsigned char | a | ||
) |
Set the rgba color.
r | the red value |
g | the green value |
b | the blue value |
a | the alpha value |
raylib::RlColor & raylib::RlColor::setGreen | ( | unsigned char | g | ) |
Set the green value.
g | the green value |
raylib::RlColor & raylib::RlColor::setRed | ( | unsigned char | r | ) |
Set the red value.
r | the red value |
Vector3f raylib::RlColor::toHSV | ( | ) |
Returns HSV values for a Color, hue [0..360], saturation/value [0..1].
std::uint32_t raylib::RlColor::toInteger | ( | ) | const |
Retrieve the color as a 32-bit unsigned integer (hexadecimal)
|
static |
Beige
|
static |
Black
|
static |
Blue
|
static |
Brown
|
static |
Dark Blue
|
static |
Dark Brown
|
static |
Dark Gray
|
static |
Dark Green
|
static |
Dark Purple
|
static |
Gold
|
static |
Gray
|
static |
Green
|
static |
Light Gray
|
static |
Lime
|
static |
Magenta
|
static |
Maroon
|
static |
Orange
|
static |
Pink
|
static |
Purple
|
static |
Raylib White
|
static |
Red
|
static |
Sky Blue
|
static |
Transparent (Blank)
|
static |
Violet
|
static |
White
|
static |
Yellow