Skip to content

Commit 38bb2d2

Browse files
Convert whitesmoke to hex before parsing it
This fixes many deprecation errors on the mobile scoreboard.
1 parent 2226a51 commit 38bb2d2

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

webapp/src/Twig/TwigExtension.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,9 +1134,9 @@ public function fileTypeIcon(string $type): string
11341134

11351135
public function problemBadge(ContestProblem $problem, bool $grayedOut = false): string
11361136
{
1137-
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
1137+
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
11381138
if ($grayedOut) {
1139-
$rgb = 'whitesmoke';
1139+
$rgb = Utils::convertToHex('whitesmoke');
11401140
}
11411141
$background = Utils::parseHexColor($rgb);
11421142

@@ -1164,9 +1164,9 @@ public function problemBadge(ContestProblem $problem, bool $grayedOut = false):
11641164

11651165
public function problemBadgeMaybe(ContestProblem $problem, ScoreboardMatrixItem $matrixItem): string
11661166
{
1167-
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
1167+
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
11681168
if (!$matrixItem->isCorrect) {
1169-
$rgb = 'whitesmoke';
1169+
$rgb = Utils::convertToHex('whitesmoke');
11701170
}
11711171
$background = Utils::parseHexColor($rgb);
11721172

0 commit comments

Comments
 (0)