Arreglos estetics i de colorets en hiscore_table.cpp
This commit is contained in:
@@ -44,6 +44,30 @@ struct Color
|
||||
Uint8 r, g, b;
|
||||
constexpr Color() : r(0), g(0), b(0) {}
|
||||
explicit constexpr Color(int red, int green, int blue) : r(red), g(green), b(blue) {}
|
||||
|
||||
// Método para obtener el color inverso
|
||||
constexpr Color getInverse() const
|
||||
{
|
||||
return Color(255 - r, 255 - g, 255 - b);
|
||||
}
|
||||
|
||||
// Método para aclarar el color
|
||||
Color lighten(int amount = 50) const
|
||||
{
|
||||
return Color(
|
||||
std::min(255, r + amount),
|
||||
std::min(255, g + amount),
|
||||
std::min(255, b + amount));
|
||||
}
|
||||
|
||||
// Método para oscurecer el color
|
||||
Color darken(int amount = 50) const
|
||||
{
|
||||
return Color(
|
||||
std::max(0, r - amount),
|
||||
std::max(0, g - amount),
|
||||
std::max(0, b - amount));
|
||||
}
|
||||
};
|
||||
|
||||
// Posiciones de las notificaciones
|
||||
@@ -177,4 +201,5 @@ extern const Color scoreboard_normal_color;
|
||||
extern const Color scoreboard_hard_color;
|
||||
extern const Color flash_color;
|
||||
extern const Color fade_color;
|
||||
extern const Color orange_color;
|
||||
extern const Color orange_color;
|
||||
extern const Color orange_soft_color;
|
||||
Reference in New Issue
Block a user