This commit is contained in:
2026-04-05 23:47:54 +02:00
parent 25ecc74251
commit c4a26ffa0f
96 changed files with 457 additions and 307 deletions

View File

@@ -361,6 +361,12 @@ auto stringToColor(const std::string& str) -> Uint8 {
{"white", 14},
{"bright_white", 15},
// Índices extendidos (paletas de 32 colores): nombres genéricos COLOR_N
{"color_16", 16}, {"color_17", 17}, {"color_18", 18}, {"color_19", 19},
{"color_20", 20}, {"color_21", 21}, {"color_22", 22}, {"color_23", 23},
{"color_24", 24}, {"color_25", 25}, {"color_26", 26}, {"color_27", 27},
{"color_28", 28}, {"color_29", 29}, {"color_30", 30}, {"color_31", 31},
{"transparent", 255}};
// Busca el color en el mapa
@@ -393,6 +399,7 @@ auto colorToString(Uint8 index) -> std::string {
"yellow", "bright_yellow",
"white", "bright_white"};
if (index < NAMES.size()) { return NAMES[index]; }
if (index < 32) { return "color_" + std::to_string(index); }
if (index == 255) { return "transparent"; }
return std::to_string(index);
}