utils: Añadidas las funciones darkenColor y lightenColor

This commit is contained in:
2023-05-28 09:17:30 +02:00
parent 73849a2fef
commit 2b5a2cb588
3 changed files with 33 additions and 4 deletions

View File

@@ -61,7 +61,8 @@ void OnScreenKeyboard::fillTexture()
text->write(text->getCharacterSize(), text->getCharacterSize(), caption);
// Dibuja el cuadro donde va el texto que se escribirá
SDL_SetRenderDrawColor(renderer, bgColor.r - 10, bgColor.g - 10, bgColor.b - 10, 255);
const color_t darkColor = darkenColor(bgColor, 10);
SDL_SetRenderDrawColor(renderer, darkColor.r, darkColor.g, darkColor.b, 255);
const int x_rect = (text->getCharacterSize() * 2) + text->lenght(caption);
const int y_rect = text->getCharacterSize();
const int w_rect = width - text->getCharacterSize() - x_rect;