Skip to content

Commit 7fbd06c

Browse files
committed
Signal on transparent problem colors
1 parent e81837d commit 7fbd06c

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

webapp/src/Service/CheckConfigService.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ public function checkContestsValidate(): ConfigCheckItem
474474
if (empty($cp->getColor())) {
475475
$result = ($result === 'E' ? 'E' : 'W');
476476
$cperrors[$cid] .= " - No color for problem `" . $cp->getShortname() . "` in contest c" . $cid . "\n";
477+
} elseif (count(Utils::parseHexColor($cp->getColor())) === 4 && Utils::parseHexColor($cp->getColor())[3] !== 255) {
478+
$result = ($result === 'E' ? 'E' : 'W');
479+
$cperrors[$cid] .= " - Semi-transparent color for problem `" . $cp->getShortname() . "` in contest c" . $cid . "\n";
477480
}
478481
}
479482
}

webapp/src/Utils/Utils.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,9 @@ public static function convertToColor(string $hex): ?string
343343
}
344344

345345
/**
346-
* Parse a hex color into it's three RGB values.
346+
* Parse a hex color into it's four RGBA values.
347347
*
348-
* @return array{int, int, int}
348+
* @return array{int, int, int, int}
349349
*/
350350
public static function parseHexColor(string $hex): array
351351
{

0 commit comments

Comments
 (0)