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

Like RGB, but also has an alpha channel representing transparency. More...

#include <rgba.hpp>

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

Public Member Functions

constexpr RGBA (uint8_t red=0, uint8_t green=0, uint8_t blue=0, uint8_t alpha=0)
 Construct an RGBA color.
 
constexpr RGBA (RGB rgb, uint8_t alpha)
 Construct an RGBA color from an RGB color.
 
constexpr auto operator== (const RGBA &rgba) const -> bool
 Compare 2 RGBAs.
 
- Public Member Functions inherited from KTech::RGB
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 a
 Alpha channel.
 
- Public Attributes inherited from KTech::RGB
uint8_t r
 Red primary color.
 
uint8_t g
 Green primary color.
 
uint8_t b
 Blue primary color.
 

Detailed Description

Like RGB, but also has an alpha channel representing transparency.

Constructor & Destructor Documentation

◆ RGBA() [1/2]

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

Construct an RGBA color.

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

◆ RGBA() [2/2]

KTech::RGBA::RGBA ( RGB rgb,
uint8_t alpha )
inlineconstexpr

Construct an RGBA color from an RGB color.

Parameters
[in]rgbRGB base.
[in]alphaAlpha channel.

Member Function Documentation

◆ operator==()

auto KTech::RGBA::operator== ( const RGBA & rgba) const -> bool
inlineconstexpr

Compare 2 RGBAs.

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

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