Implementar sistema flexible de temas con cantidad variable de colores

- Refactorizar ThemeColors para usar std::vector<Color> en lugar de array fijo
- Cada tema puede tener cualquier cantidad de colores (8, 12, 24, etc.)
- Expandir tema RGB a 24 colores del círculo cromático (cada 15°)
- Añadir función initializeThemes() para configuración dinámica
- Mantener temas originales con 8 colores cada uno
- Tema RGB ahora incluye transiciones suaves por todo el espectro

Paleta RGB matemáticamente perfecta:
- 6 colores primarios: R, Y, G, C, B, M (cada 60°)
- 18 colores intermedios: transiciones cada 15°
- Cobertura completa del círculo cromático 0°-345°

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-09-18 22:22:57 +02:00
parent ac57755bd2
commit 4e030e4ef9
2 changed files with 68 additions and 27 deletions

View File

@@ -69,32 +69,11 @@ private:
struct ThemeColors {
float bg_top_r, bg_top_g, bg_top_b;
float bg_bottom_r, bg_bottom_g, bg_bottom_b;
int ball_colors[8][3];
std::vector<Color> ball_colors;
};
// Temas de colores definidos
ThemeColors themes_[5] = {
// SUNSET: Naranjas, rojos, amarillos, rosas
{180.0f / 255.0f, 140.0f / 255.0f, 100.0f / 255.0f, // Fondo superior (naranja suave)
40.0f / 255.0f, 20.0f / 255.0f, 60.0f / 255.0f, // Fondo inferior (púrpura oscuro)
{{255, 140, 0}, {255, 69, 0}, {255, 215, 0}, {255, 20, 147}, {255, 99, 71}, {255, 165, 0}, {255, 192, 203}, {220, 20, 60}}},
// OCEAN: Azules, turquesas, blancos
{100.0f / 255.0f, 150.0f / 255.0f, 200.0f / 255.0f, // Fondo superior (azul cielo)
20.0f / 255.0f, 40.0f / 255.0f, 80.0f / 255.0f, // Fondo inferior (azul marino)
{{0, 191, 255}, {0, 255, 255}, {32, 178, 170}, {176, 224, 230}, {70, 130, 180}, {0, 206, 209}, {240, 248, 255}, {64, 224, 208}}},
// NEON: Cian, magenta, verde lima, amarillo vibrante
{20.0f / 255.0f, 20.0f / 255.0f, 40.0f / 255.0f, // Fondo superior (negro azulado)
0.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f, // Fondo inferior (negro)
{{0, 255, 255}, {255, 0, 255}, {50, 205, 50}, {255, 255, 0}, {255, 20, 147}, {0, 255, 127}, {138, 43, 226}, {255, 69, 0}}},
// FOREST: Verdes, marrones, amarillos otoño
{144.0f / 255.0f, 238.0f / 255.0f, 144.0f / 255.0f, // Fondo superior (verde claro)
101.0f / 255.0f, 67.0f / 255.0f, 33.0f / 255.0f, // Fondo inferior (marrón tierra)
{{34, 139, 34}, {107, 142, 35}, {154, 205, 50}, {255, 215, 0}, {210, 180, 140}, {160, 82, 45}, {218, 165, 32}, {50, 205, 50}}},
// RGB: Colores RGB puros y subdivisiones matemáticas
{1.0f, 1.0f, 1.0f, // Fondo superior (blanco puro)
1.0f, 1.0f, 1.0f, // Fondo inferior (blanco puro) - sin degradado
{{255, 0, 0}, {0, 255, 0}, {0, 0, 255}, {255, 255, 0}, {0, 255, 255}, {255, 0, 255}, {128, 255, 128}, {255, 128, 128}}}
};
ThemeColors themes_[5];
// Batch rendering
std::vector<SDL_Vertex> batch_vertices_;
@@ -116,6 +95,7 @@ private:
void toggleFullscreen();
void toggleRealFullscreen();
std::string gravityDirectionToString(GravityDirection direction) const;
void initializeThemes();
// Sistema de zoom dinámico
int calculateMaxWindowZoom() const;