Color: afegit static Color fromHex(const std::string& hexStr)

This commit is contained in:
2025-06-26 11:42:37 +02:00
parent 1ed09226e0
commit 78efcbccb7
6 changed files with 50 additions and 44 deletions

View File

@@ -5,7 +5,7 @@
#include "utils.h" // Archivo de utilidades
// Tamaño máximo del nombre
constexpr size_t NAME_SIZE = 3;
constexpr size_t NAME_SIZE = 5;
// Clase EnterName
class EnterName
@@ -32,9 +32,9 @@ private:
std::string name_; // Nombre en proceso
size_t position_ = 0; // Índice del carácter que se edita
bool position_overflow_ = false; // Flag para exceder límite
std::array<int, NAME_SIZE> character_index_; // Índices a `character_list_`
std::array<int, NAME_SIZE> character_index_; // Índices a "character_list_"
void updateNameFromCharacterIndex(); // Actualiza `name_` según `character_index_`
void updateNameFromCharacterIndex(); // Actualiza "name_" según "character_index_"
void initCharacterIndex(const std::string &name); // Inicializa índices desde el nombre
int findIndex(char character) const; // Busca el índice de un carácter en `character_list_`
int findIndex(char character) const; // Busca el índice de un carácter en "character_list_"
};