27#include <guichan/color.hpp>
61 const gcn::Color &color,
62 const std::optional<gcn::Color> &outlineColor,
85 return mColors[type].outlineColor;
106 {
return mColors[type].delay; }
Class controlling the game's color palette.
static const gcn::Color RAINBOW_COLORS[]
Colors used for the rainbow gradient.
void advanceGradient(int advance)
GradientType getGradientType(int type) const
Gets the GradientType associated with the specified type.
Palette(const Palette &)=delete
static const int RAINBOW_COLOR_COUNT
Number of Elemets of RAINBOW_COLORS.
std::set< Palette * > Palettes
static Palettes mInstances
static void advanceGradients()
Updates all colors, that are non-static.
const gcn::Color & getColor(int type) const
Gets the color associated with the type.
void setColor(int type, const gcn::Color &color, const std::optional< gcn::Color > &outlineColor, GradientType grad, int delay)
Palette & operator=(const Palette &)=delete
std::vector< ColorElem * > mGradVector
std::vector< ColorElem > mColors
Vector containing the colors.
const std::optional< gcn::Color > & getOutlineColor(int type) const
Gets the optional outline color associated with the type.
GradientType
Colors can be static or can alter over time.
static Timer mRainbowTimer
Timer used when updating gradient-type colors.
int getGradientDelay(int type) const
Gets the gradient delay for the specified type.
Simple timer that can be used to check if a certain amount of time has passed.
constexpr int GRADIENT_DELAY
GradientType committedGrad
std::optional< gcn::Color > outlineColor
gcn::Color committedColor
void set(int type, const gcn::Color &color, GradientType grad, int delay)