KTech 1.1.0
C++ 2D terminal game engine library
Loading...
Searching...
No Matches
KTech::RGB Struct Reference

24-bit color, able of representing 16,777,216 (2^24) different colors. More...

#include <rgb.hpp>

Inheritance diagram for KTech::RGB:
KTech::RGBA

Public Member Functions

constexpr RGB (uint8_t red=0, uint8_t green=0, uint8_t blue=0)
 Construct an RGB color.
 
constexpr auto operator== (const RGB &rgb) const -> bool
 Compare 2 RGBs.
 

Public Attributes

uint8_t r
 Red primary color.
 
uint8_t g
 Green primary color.
 
uint8_t b
 Blue primary color.
 

Detailed Description

24-bit color, able of representing 16,777,216 (2^24) different colors.

Constructor & Destructor Documentation

◆ RGB()

KTech::RGB::RGB ( uint8_t red = 0,
uint8_t green = 0,
uint8_t blue = 0 )
inlineconstexpr

Construct an RGB color.

Parameters
[in]redRed primary color.
[in]greenGreen primary color.
[in]blueBlue primary color.

Member Function Documentation

◆ operator==()

auto KTech::RGB::operator== ( const RGB & rgb) const -> bool
inlineconstexpr

Compare 2 RGBs.

Parameters
[in]rgbThe RGB to compare with this RGB.
Returns
true: the red, green and blue primary colors are equal. false: they are unequal.

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