Public Member Functions | List of all members
Color Class Reference

Object representing a RGB color. More...

#include <jngl/Color.hpp>

Public Member Functions

 Color (unsigned char red, unsigned char green, unsigned char blue)
unsigned char getRed () const
void setRed (unsigned char)
unsigned char getGreen () const
void setGreen (unsigned char)
unsigned char getBlue () const
void setBlue (unsigned char)

Detailed Description

Object representing a RGB color.

You can use the custom literal operator to create a jngl::Color from HTML color codes. For example #68da4f becomes:

jngl::Color color = 0x68da4f_rgb;
Object representing a RGB color.
Definition: Color.hpp:25

You can use this to quickly pass a HTML code to jngl::setColor. The following lines are equivalent:

jngl::setColor(jngl::Color(0x68, 0xda, 0x4f));
jngl::setColor(jngl::Color(104, 218, 79));
void setColor(jngl::Color rgb)
Sets the color which should be used to draw primitives.

Definition at line 25 of file Color.hpp.

Constructor & Destructor Documentation

◆ Color()

Color ( unsigned char  red,
unsigned char  green,
unsigned char  blue 

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