VoltMod
C++23 framework for CS2 server plugins
Loading...
Searching...
No Matches
Color.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
5namespace VoltMod
6{
7
8/**
9 * @brief An RGBA color in the engine's byte order, as `m_clrRender` and glow colors hold it.
10 *
11 * A channel left out stays 255, so `Color{}` is opaque white, `Color{255, 0, 0}` is opaque red
12 * and `Color{.A = 0}` is invisible.
13 */
14struct Color
15{
16 uint8_t R = 255;
17 uint8_t G = 255;
18 uint8_t B = 255;
19 uint8_t A = 255;
20
21 bool operator==(const Color&) const = default;
22};
23
24// Generated accessors read and write it in place of the engine's 4-byte Color.
25static_assert(sizeof(Color) == 4);
26
27} // namespace VoltMod
static std::string ReadFile(const std::filesystem::path &path)
Definition Loader.cpp:56
An RGBA color in the engine's byte order, as m_clrRender and glow colors hold it.
Definition Color.hpp:15
uint8_t A
Definition Color.hpp:19
uint8_t G
Definition Color.hpp:17
bool operator==(const Color &) const =default
uint8_t B
Definition Color.hpp:18
uint8_t R
Definition Color.hpp:16