Flint Engine
Modular C++20 2D game engine powered by SDL3
Loading...
Searching...
No Matches
Flint::Color Struct Reference

RGBA color with 8-bit unsigned components. More...

#include <flint/graphics/types/color.h>

+ Collaboration diagram for Flint::Color:

Public Member Functions

constexpr Color (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
 Construct a color from explicit RGBA components.
 
constexpr bool operator== (const Color &other) const
 

Public Attributes

unsigned char r
 
unsigned char g
 
unsigned char b
 
unsigned char a
 

Detailed Description

RGBA color with 8-bit unsigned components.

Component values range from 0 (none) to 255 (full). Alpha defaults to fully opaque (255) when not specified.

Definition at line 13 of file color.h.

Constructor & Destructor Documentation

◆ Color() [1/2]

Flint::Color::Color ( )
inlineconstexpr

Definition at line 16 of file color.h.

◆ Color() [2/2]

Flint::Color::Color ( unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a = 255 )
inlineconstexpr

Construct a color from explicit RGBA components.

Parameters
rRed channel [0, 255].
gGreen channel [0, 255].
bBlue channel [0, 255].
aAlpha channel [0, 255] (255 = fully opaque).

Definition at line 31 of file color.h.

Member Function Documentation

◆ operator==()

bool Flint::Color::operator== ( const Color & other) const
inlineconstexpr

Definition at line 38 of file color.h.

Member Data Documentation

◆ a

unsigned char Flint::Color::a

Definition at line 14 of file color.h.

◆ b

unsigned char Flint::Color::b

Definition at line 14 of file color.h.

◆ g

unsigned char Flint::Color::g

Definition at line 14 of file color.h.

◆ r

unsigned char Flint::Color::r

Definition at line 14 of file color.h.


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