ezgl  1.0.1
An Easy Graphics & GUI Library
Public Member Functions | Public Attributes | List of all members
ezgl::color Struct Reference

Represents a color as a mixture or red, green, and blue as well as the transparency level. More...

#include <color.hpp>

Public Member Functions

constexpr color () noexcept
 Default constructor: Create a black color.
 
constexpr color (std::uint_fast8_t r, std::uint_fast8_t g, std::uint_fast8_t b, std::uint_fast8_t a=255) noexcept
 Create a color. More...
 
bool operator== (const color &rhs) const
 Test for equality.
 
bool operator!= (const color &rhs) const
 Test for inequality.
 

Public Attributes

std::uint_fast8_t red
 A red component of the color, between 0 and 255.
 
std::uint_fast8_t green
 The green component of the color, between 0 and 255.
 
std::uint_fast8_t blue
 The blue component of the color, between 0 and 255.
 
std::uint_fast8_t alpha
 The amount of transparency, between 0 and 255.
 

Detailed Description

Represents a color as a mixture or red, green, and blue as well as the transparency level.

Each color channel and transparency level is an 8-bit value, ranging from 0-255.

Constructor & Destructor Documentation

◆ color()

constexpr ezgl::color::color ( std::uint_fast8_t  r,
std::uint_fast8_t  g,
std::uint_fast8_t  b,
std::uint_fast8_t  a = 255 
)
inlineconstexprnoexcept

Create a color.

Parameters
rThe amount of red.
gThe amount of green.
bThe amount of blue.
aThe level of transparency.

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