StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
Color.hpp
1#pragma once
2#include <stdint.h>
3
4namespace StevEngine {
5 namespace Utilities {
12 struct Color {
13 uint8_t r;
14 uint8_t g;
15 uint8_t b;
16 uint8_t a;
17
25 Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) : r(r), g(g), b(b), a(a) {}
26
33 Color(uint8_t r, uint8_t g, uint8_t b) : r(r), g(g), b(b), a(255) {}
34
39 Color(uint8_t v) : r(v), g(v), b(v), a(255) {}
40
42 Color() : r(255), g(255), b(255), a(255) {};
43
48 const float* data() const;
49 };
50 }
51}
Color()
Create white color.
Definition Color.hpp:42
uint8_t g
Green channel (0-255)
Definition Color.hpp:14
uint8_t a
Alpha channel (0-255)
Definition Color.hpp:16
Color(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Create color with all channels.
Definition Color.hpp:25
uint8_t r
Red channel (0-255)
Definition Color.hpp:13
Color(uint8_t v)
Create grayscale color.
Definition Color.hpp:39
uint8_t b
Blue channel (0-255)
Definition Color.hpp:15
Color(uint8_t r, uint8_t g, uint8_t b)
Create opaque color.
Definition Color.hpp:33
const float * data() const
Get color as float array.
Definition Color.cpp:5