JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
Rgb Class Reference

Object representing a RGB color, new version of jngl::Color (which will be deprecated in the future) More...

#include <jngl/Rgb.hpp>

Public Member Functions

constexpr Rgb (float red, float green, float blue)
 
 Rgb (Color)
 Implicit conversion for backwards compatibility.
 
constexpr float getRed () const
 0.0f ... 1.0f
 
void setRed (float)
 0.0f ... 1.0f
 
constexpr float getGreen () const
 0.0f ... 1.0f
 
void setGreen (float)
 0.0f ... 1.0f
 
constexpr float getBlue () const
 0.0f ... 1.0f
 
void setBlue (float)
 0.0f ... 1.0f
 
uint8_t getRed_u8 () const
 0 ... 255
 
uint8_t getGreen_u8 () const
 0 ... 255
 
uint8_t getBlue_u8 () const
 0 ... 255
 
 operator Color () const
 Conversion for backwards compatibility.
 

Static Public Member Functions

static constexpr Rgb u8 (uint8_t red, uint8_t green, uint8_t blue)
 

Detailed Description

Object representing a RGB color, new version of jngl::Color (which will be deprecated in the future)

Definition at line 21 of file Rgb.hpp.

Constructor & Destructor Documentation

◆ Rgb()

Rgb ( float red,
float green,
float blue )
inlineconstexpr
Parameters
red0.0f ... 1.0f
green0.0f ... 1.0f
blue0.0f ... 1.0f

Values over 1.0f will result in 1.0f and negatives will result in 0.0f.

Definition at line 28 of file Rgb.hpp.

Member Function Documentation

◆ u8()

static constexpr Rgb u8 ( uint8_t red,
uint8_t green,
uint8_t blue )
inlinestaticconstexpr

Definition at line 31 of file Rgb.hpp.

◆ getRed()

float getRed ( ) const
inlineconstexpr

0.0f ... 1.0f

Definition at line 40 of file Rgb.hpp.

◆ getGreen()

float getGreen ( ) const
inlineconstexpr

0.0f ... 1.0f

Definition at line 47 of file Rgb.hpp.

◆ getBlue()

float getBlue ( ) const
inlineconstexpr

0.0f ... 1.0f

Definition at line 54 of file Rgb.hpp.


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