Skip to content

Commit 296242d

Browse files
Convert whitesmoke to hex before parsing it
This fixes many deprecation errors on the mobile scoreboard. (cherry picked from commit bb76ced)
1 parent edab328 commit 296242d

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
@@ -1065,9 +1065,9 @@ public function fileTypeIcon(string $type): string
10651065

10661066
public function problemBadge(ContestProblem $problem, bool $grayedOut = false): string
10671067
{
1068-
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
1068+
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
10691069
if ($grayedOut) {
1070-
$rgb = 'whitesmoke';
1070+
$rgb = Utils::convertToHex('whitesmoke');
10711071
}
10721072
$background = Utils::parseHexColor($rgb);
10731073

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

10961096
public function problemBadgeMaybe(ContestProblem $problem, ScoreboardMatrixItem $matrixItem): string
10971097
{
1098-
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
1098+
$rgb = Utils::convertToHex($problem->getColor() ?? '#ffffff');
10991099
if (!$matrixItem->isCorrect) {
1100-
$rgb = 'whitesmoke';
1100+
$rgb = Utils::convertToHex('whitesmoke');
11011101
}
11021102
$background = Utils::parseHexColor($rgb);
11031103

0 commit comments

Comments
 (0)