|
Porytiles
|
A palette container for colors that support transparency checking. More...
#include <palette.hpp>
Public Member Functions | |
| Palette ()=default | |
| Palette (ColorType color) | |
| Constructs a palette filled with a single color. | |
| void | add (ColorType color) |
| Adds a color to the end of the palette. | |
| void | set (ColorType color, std::size_t index) |
| Sets the color at a specific index in the palette. | |
| std::size_t | size () const |
| Returns the number of colors in the palette. | |
| const std::vector< ColorType > & | colors () const |
| Returns a const reference to the internal color vector. | |
A palette container for colors that support transparency checking.
Palette is a simple vector-backed container for storing colors that satisfy the SupportsTransparency concept. It provides basic operations for adding, setting, and accessing colors in the palette. The palette has no hard size limit, but is typically used with palettes of size 16 (the GBA standard palette size).
The ColorType template parameter must satisfy the SupportsTransparency concept, meaning it must provide methods for checking whether a color is transparent.
| ColorType | The color type of this palette must satisfy the SupportsTransparency concept |
Definition at line 34 of file palette.hpp.
|
default |
|
inlineexplicit |
Constructs a palette filled with a single color.
Creates a palette containing 16 copies of the provided color. This is useful for creating uniform palettes or placeholder palettes.
| color | The color to fill the palette with |
Definition at line 47 of file palette.hpp.
|
inline |
Adds a color to the end of the palette.
Appends the provided color to the palette's internal color vector.
| color | The color to add |
Definition at line 62 of file palette.hpp.
|
inline |
Returns a const reference to the internal color vector.
Definition at line 99 of file palette.hpp.
|
inline |
Sets the color at a specific index in the palette.
Replaces the color at the given index with the provided color. Panics if the index is out of bounds.
| color | The color to set |
| index | The index at which to set the color |
Definition at line 76 of file palette.hpp.
|
inline |
Returns the number of colors in the palette.
Definition at line 89 of file palette.hpp.