raylib-cpp
C++ object-oriented wrapper library for raylib.
Public Member Functions | Static Public Member Functions | List of all members
raylib::Color Class Reference

Color type, RGBA (32bit) More...

Public Member Functions

 Color ()
 Black.
 
 Color (::Vector3 hsv)
 Returns a Color from HSV values.
 
 Color (::Vector4 normalized)
 Returns Color from normalized values [0..1].
 
 Color (const ::Color &color)
 
 Color (unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha=255)
 
 Color (unsigned int hexValue)
 Get Color structure from hexadecimal value.
 
Color Alpha (float alpha) const
 Returns color with alpha applied, alpha goes from 0.0f to 1.0f.
 
Color AlphaBlend (::Color dst, ::Color tint) const
 Returns src alpha-blended into dst color with tint.
 
ColorClearBackground ()
 Set background color (framebuffer clear color)
 
ColorDrawLine (::Vector2 startPos, ::Vector2 endPos)
 
ColorDrawLine (::Vector2 startPos, ::Vector2 endPos, float thick)
 
ColorDrawLine (int startPosX, int startPosY, int endPosX, int endPosY)
 Draw a line.
 
ColorDrawLineBezier (::Vector2 startPos, ::Vector2 endPos, float thick)
 
ColorDrawLineStrip (::Vector2 *points, int numPoints)
 
ColorDrawPixel (::Vector2 pos)
 Draw a pixel.
 
ColorDrawPixel (int x, int y)
 
ColorDrawRectangle (::Rectangle rec)
 
ColorDrawRectangle (::Rectangle rec, ::Vector2 origin, float rotation)
 
ColorDrawRectangle (::Vector2 position, ::Vector2 size)
 
ColorDrawRectangle (int posX, int posY, int width, int height)
 
ColorDrawRectangleLines (::Rectangle rec, float lineThick)
 
ColorDrawRectangleLines (int posX, int posY, int width, int height)
 
ColorDrawText (const ::Font &font, const std::string &text, ::Vector2 position, ::Vector2 origin, float rotation, float fontSize, float spacing)
 
ColorDrawText (const ::Font &font, const std::string &text, ::Vector2 position, float fontSize, float spacing)
 
ColorDrawText (const std::string &text, int posX, int posY, int fontSize)
 
Color Fade (float alpha) const
 Returns color with alpha applied, alpha goes from 0.0f to 1.0f.
 
unsigned char GetA () const
 Retrieves the a value for the object. More...
 
unsigned char GetB () const
 Retrieves the b value for the object. More...
 
unsigned char GetG () const
 Retrieves the g value for the object. More...
 
unsigned char GetR () const
 Retrieves the r value for the object. More...
 
Vector4 Normalize () const
 Returns Color normalized as float [0..1].
 
 operator int () const
 Returns hexadecimal value for a Color.
 
Coloroperator= (const ::Color &color)
 
void SetA (unsigned char value)
 Sets the a value for the object. More...
 
void SetB (unsigned char value)
 Sets the b value for the object. More...
 
void SetG (unsigned char value)
 Sets the g value for the object. More...
 
void SetR (unsigned char value)
 Sets the r value for the object. More...
 
Vector3 ToHSV () const
 Returns HSV values for a Color.
 
int ToInt () const
 Returns hexadecimal value for a Color.
 

Static Public Member Functions

static Color Beige ()
 
static Color Black ()
 
static Color Blank ()
 
static Color Blue ()
 
static Color Brown ()
 
static Color DarkBlue ()
 
static Color DarkBrown ()
 
static Color DarkGray ()
 
static Color DarkGreen ()
 
static Color DarkPurple ()
 
::Color FromHSV (float hue, float saturation, float value)
 Returns a Color from HSV values.
 
static Color Gold ()
 
static Color Gray ()
 
static Color Green ()
 
static Color LightGray ()
 
static Color Lime ()
 
static Color Magenta ()
 
static Color Maroon ()
 
static Color Orange ()
 
static Color Pink ()
 
static Color Purple ()
 
static Color RayWhite ()
 
static Color Red ()
 
static Color SkyBlue ()
 
static Color Violet ()
 
static Color White ()
 
static Color Yellow ()
 

Detailed Description

Color type, RGBA (32bit)

Definition at line 14 of file Color.hpp.

Member Function Documentation

◆ GetA()

unsigned char raylib::Color::GetA ( ) const
inline

Retrieves the a value for the object.

Returns
The a value of the object.

Definition at line 97 of file Color.hpp.

◆ GetB()

unsigned char raylib::Color::GetB ( ) const
inline

Retrieves the b value for the object.

Returns
The b value of the object.

Definition at line 96 of file Color.hpp.

◆ GetG()

unsigned char raylib::Color::GetG ( ) const
inline

Retrieves the g value for the object.

Returns
The g value of the object.

Definition at line 95 of file Color.hpp.

◆ GetR()

unsigned char raylib::Color::GetR ( ) const
inline

Retrieves the r value for the object.

Returns
The r value of the object.

Definition at line 94 of file Color.hpp.

◆ SetA()

void raylib::Color::SetA ( unsigned char  value)
inline

Sets the a value for the object.

Parameters
valueThe value of which to set a to.

Definition at line 97 of file Color.hpp.

◆ SetB()

void raylib::Color::SetB ( unsigned char  value)
inline

Sets the b value for the object.

Parameters
valueThe value of which to set b to.

Definition at line 96 of file Color.hpp.

◆ SetG()

void raylib::Color::SetG ( unsigned char  value)
inline

Sets the g value for the object.

Parameters
valueThe value of which to set g to.

Definition at line 95 of file Color.hpp.

◆ SetR()

void raylib::Color::SetR ( unsigned char  value)
inline

Sets the r value for the object.

Parameters
valueThe value of which to set r to.

Definition at line 94 of file Color.hpp.