Euphoria
|
eu::core::Palette Struct Reference
#include <palette.h>
Public Member Functions | |
constexpr | Palette (const std::string_view &n, const ranges::span< const Rgbi > &c) |
const Rgbi & | get_random_color (Random *r) const |
Get a random color. More... | |
const Rgbi & | get_safe_index (unsigned int i) const |
Get a color based on the index. More... | |
const Rgbi & | get_closest_color (const Rgbi &c) const |
int | get_index_closest (const Rgbi &c) const |
Public Attributes | |
std::string_view | name |
the name of the palette More... | |
ranges::span< const Rgbi > | colors |
Detailed Description
Constructor & Destructor Documentation
◆ Palette()
|
inlineconstexpr |
Member Function Documentation
◆ get_closest_color()
Definition at line 39 of file palette.cc.
◆ get_index_closest()
int eu::core::Palette::get_index_closest | ( | const Rgbi & | c | ) | const |
Definition at line 46 of file palette.cc.
◆ get_random_color()
Get a random color.
- Parameters
-
r the random generator to use
- Returns
- a random color
Definition at line 25 of file palette.cc.
◆ get_safe_index()
const Rgbi & eu::core::Palette::get_safe_index | ( | unsigned int | i | ) | const |
Get a color based on the index.
The index is modulated based on the palette size, ensuring a valid color.
- Parameters
-
i the index
- Returns
- the color
Definition at line 32 of file palette.cc.
Member Data Documentation
◆ colors
◆ name
std::string_view eu::core::Palette::name |
The documentation for this struct was generated from the following files:
- libs/core/src/core/palette.h
- libs/core/src/core/palette.cc