JNGL
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
 0...255
 
void setRed (unsigned char)
 0...255
 
unsigned char getGreen () const
 0...255
 
void setGreen (unsigned char)
 0...255
 
unsigned char getBlue () const
 0...255
 
void setBlue (unsigned char)
 0...255
 

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;

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

jngl::setColor(0x68da4f_rgb);
jngl::setColor(jngl::Color(0x68, 0xda, 0x4f));
jngl::setColor(jngl::Color(104, 218, 79));

Definition at line 24 of file Color.hpp.

Constructor & Destructor Documentation

◆ Color()

Color ( unsigned char  red,
unsigned char  green,
unsigned char  blue 
)
Parameters
red0...255
green0...255
blue0...255

The documentation for this class was generated from the following file:
jngl::Color
Object representing a RGB color.
Definition: Color.hpp:24
jngl::setColor
void setColor(jngl::Color rgb)
Sets the color which should be used to draw primitives.