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

Contains jngl::Rgb class. More...

#include <cstddef>
#include <cstdint>
#include <iosfwd>
Include dependency graph for Rgb.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Namespaces

namespace  jngl
 JNGL's main namespace.
 

Functions

Rgb mix (Rgb a, Rgb b, float t)
 Returns a color mix between a (t == 0) and b (t == 1)
 
Rgb interpolate (Rgb a, Rgb b, float t)
 Old name for mix, will be removed in a future release.
 
Rgb getBackgroundColor ()
 Returns the screen's background color which is visible when nothing is drawn and also used by jngl::Fade.
 
bool operator== (Rgb a, Rgb b)
 Returns true if the two colors are equal in 24 bit SDR space, i.e.
 
std::ostreamoperator<< (std::ostream &os, Rgb color)
 Prints the color as jngl::Rgb{ red, green, blue }
 
jngl::Rgb operator""_rgb (unsigned long long)
 Create a jngl::Rgb object from a literal. E.g. 0x00ff00_rgb for green.
 
void invalid_hex_character_in_color_literal ()
 
void invalid_rgb_color_literal_expected_format_hash_rrggbb ()
 
consteval uint8_t hexVal (char c)
 
consteval uint8_t hexByte (const char *s)
 
consteval jngl::Rgb operator""_rgb (const char *hex, size_t length)
 Create a jngl::Rgb object from a literal. E.g. "#00ff00"_rgb for green.
 

Detailed Description

Contains jngl::Rgb class.

Definition in file Rgb.hpp.

Function Documentation

◆ hexVal()

uint8_t hexVal ( char c)
consteval

Definition at line 121 of file Rgb.hpp.

◆ hexByte()

uint8_t hexByte ( const char * s)
consteval

Definition at line 134 of file Rgb.hpp.

◆ operator""_rgb()

jngl::Rgb operator""_rgb ( const char * hex,
size_t length )
consteval

Create a jngl::Rgb object from a literal. E.g. "#00ff00"_rgb for green.

Definition at line 140 of file Rgb.hpp.