Corregido bug en el calculo del color del marcador

This commit is contained in:
2022-11-08 19:32:28 +01:00
parent 977e134172
commit db56185be2
4 changed files with 10 additions and 12 deletions

View File

@@ -500,15 +500,13 @@ void Game::renderBlackScreen()
void Game::setScoreBoardColor()
{
// Obtiene el color del borde
const color_t c = room->getBorderColor();
const color_t colorBorder = room->getBorderColor();
// Si el color es negro lo cambia a blanco
const color_t cBlack = stringToColor(options->palette, "black");
board.color = colorAreEqual(c, cBlack) ? stringToColor(options->palette, "white") : c;
const bool isBlack = colorAreEqual(colorBorder, stringToColor(options->palette, "black"));
const bool isBrightBlack = colorAreEqual(colorBorder, stringToColor(options->palette, "bright_black"));
// Si el color es negro brillante lo cambia a blanco
const color_t cBrightBlack = stringToColor(options->palette, "bright_black");
board.color = colorAreEqual(c, cBrightBlack) ? stringToColor(options->palette, "white") : c;
// Si el color del borde es negro o negro brillante cambia el texto del marcador a blanco
board.color = isBlack || isBrightBlack? stringToColor(options->palette, "white") : colorBorder;
}
// Comprueba si ha finalizado el juego