mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05:00
Hearts: Paint player names in white when background is a dark color
This commit is contained in:
parent
09d42261c7
commit
b53a633388
1 changed files with 2 additions and 1 deletions
|
@ -892,7 +892,8 @@ void Game::paint_event(GUI::PaintEvent& event)
|
|||
|
||||
for (auto& player : m_players) {
|
||||
auto& font = painter.font().bold_variant();
|
||||
painter.draw_text(player.name_position, player.name, font, player.name_alignment, Color::Black, Gfx::TextElision::None);
|
||||
Gfx::Color text_color = background_color.luminosity() > 80 ? Color::Black : Color::White;
|
||||
painter.draw_text(player.name_position, player.name, font, player.name_alignment, text_color, Gfx::TextElision::None);
|
||||
|
||||
if (!game_ended()) {
|
||||
for (auto& card : player.hand)
|
||||
|
|
Loading…
Add table
Reference in a new issue