Raylib C++  1.0.0
Encapsulates the raylib library
Static Public Member Functions | List of all members
raylib::helper::ColorHelper Class Reference

Helper class for Color. More...

#include <ColorHelper.hpp>

Collaboration diagram for raylib::helper::ColorHelper:
Collaboration graph

Static Public Member Functions

static RlColor colorFromNormalized (const Vector4f &normalizedColor)
 Returns RlColor from normalized values [0..1]. More...
 
static Vector3f colorToHSV (const RlColor &color)
 Returns HSV values for a Color, hue [0..360], saturation/value [0..1]. More...
 
static RlColor colorFromHSV (float hue, float saturation, float value)
 Returns a RlColor from HSV values, hue [0..360], saturation/value [0..1]. More...
 
static RlColor colorAlpha (const RlColor &color, float alpha)
 Returns color with alpha applied, alpha goes from 0.0f to 1.0f. More...
 
static RlColor colorAlphaBlend (const RlColor &dst, const RlColor &src, const RlColor &tint)
 Returns src alpha-blended into dst color with tint. More...
 
static RlColor getColor (unsigned int hexValue)
 Get RlColor structure from hexadecimal value. More...
 
static RlColor getPixelColor (void *srcPtr, int format)
 Get RlColor from a source pixel pointer of certain format. More...
 
static void setPixelColor (void *dstPtr, const RlColor &color, int format)
 Set color formatted into destination pixel pointer. More...
 
static int getPixelDataSize (int width, int height, int format)
 Get pixel data size in bytes for certain format. More...
 

Detailed Description

Helper class for Color.

Member Function Documentation

◆ colorAlpha()

raylib::RlColor raylib::helper::ColorHelper::colorAlpha ( const RlColor color,
float  alpha 
)
static

Returns color with alpha applied, alpha goes from 0.0f to 1.0f.

Parameters
colorto apply alpha to
alphato apply
Returns
the color with alpha applied
Here is the call graph for this function:

◆ colorAlphaBlend()

raylib::RlColor raylib::helper::ColorHelper::colorAlphaBlend ( const RlColor dst,
const RlColor src,
const RlColor tint 
)
static

Returns src alpha-blended into dst color with tint.

Parameters
dstto blend into
srcto blend
tintto blend with
Returns
the src alpha-blended into dst color with tint
Here is the call graph for this function:

◆ colorFromHSV()

raylib::RlColor raylib::helper::ColorHelper::colorFromHSV ( float  hue,
float  saturation,
float  value 
)
static

Returns a RlColor from HSV values, hue [0..360], saturation/value [0..1].

Parameters
hueto convert
saturationto convert
valueto convert
Returns
the RlColor from HSV values

◆ colorFromNormalized()

raylib::RlColor raylib::helper::ColorHelper::colorFromNormalized ( const Vector4f normalizedColor)
static

Returns RlColor from normalized values [0..1].

Parameters
normalizedColorto convert
Returns
the RlColor from normalized values
See also
RlColor(Vector4f)

◆ colorToHSV()

Vector3f raylib::helper::ColorHelper::colorToHSV ( const RlColor color)
static

Returns HSV values for a Color, hue [0..360], saturation/value [0..1].

Parameters
colorto convert
Returns
the HSV values for a Color
Here is the call graph for this function:

◆ getColor()

raylib::RlColor raylib::helper::ColorHelper::getColor ( unsigned int  hexValue)
static

Get RlColor structure from hexadecimal value.

Parameters
hexValueto convert
Returns
the RlColor structure from hexadecimal value
See also
RlColor(std::uint32_t)

◆ getPixelColor()

raylib::RlColor raylib::helper::ColorHelper::getPixelColor ( void *  srcPtr,
int  format 
)
static

Get RlColor from a source pixel pointer of certain format.

Parameters
srcPtrto convert
formatto convert
Returns
the RlColor from a source pixel pointer of certain format
Deprecated:
don't use this

◆ getPixelDataSize()

int raylib::helper::ColorHelper::getPixelDataSize ( int  width,
int  height,
int  format 
)
static

Get pixel data size in bytes for certain format.

Parameters
widthto get
heightto get
formatto get
Returns
the pixel data size in bytes for certain format

◆ setPixelColor()

void raylib::helper::ColorHelper::setPixelColor ( void *  dstPtr,
const RlColor color,
int  format 
)
static

Set color formatted into destination pixel pointer.

Parameters
dstPtrto set
colorto set
formatto set
Deprecated:
don't use this
Here is the call graph for this function:

The documentation for this class was generated from the following files: