Skip to content

Commit

Permalink
Convert whitesmoke to hex before parsing it
Browse files Browse the repository at this point in the history
This fixes many deprecation errors on the mobile scoreboard.

(cherry picked from commit bb76ced)
  • Loading branch information
nickygerritsen committed Nov 23, 2024
1 parent edab328 commit 296242d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions webapp/src/Twig/TwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -1065,9 +1065,9 @@ public function fileTypeIcon(string $type): string

public function problemBadge(ContestProblem $problem, bool $grayedOut = false): string
{
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
if ($grayedOut) {
$rgb = 'whitesmoke';
$rgb = Utils::convertToHex('whitesmoke');
}
$background = Utils::parseHexColor($rgb);

Expand Down Expand Up @@ -1095,9 +1095,9 @@ public function problemBadge(ContestProblem $problem, bool $grayedOut = false):

public function problemBadgeMaybe(ContestProblem $problem, ScoreboardMatrixItem $matrixItem): string
{
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
if (!$matrixItem->isCorrect) {
$rgb = 'whitesmoke';
$rgb = Utils::convertToHex('whitesmoke');
}
$background = Utils::parseHexColor($rgb);

Expand Down

0 comments on commit 296242d

Please sign in to comment.