Skip to content

Commit 1386766

Browse files
vmcjmeisterT
andauthored
Update webapp/src/Utils/Utils.php
Co-authored-by: Tobias Werth <spam-by-github@never-mind.eu>
1 parent f4e085c commit 1386766

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

webapp/src/Utils/Utils.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ public static function convertToColor(string $hex): ?string
350350
public static function parseHexColor(string $hex): array
351351
{
352352
$tmp = substr($hex, 1);
353+
// For a RGB hex value (without A), add a fully opaque alpha channel.
354+
// e.g. convert #ABC to #ABCF, and #123456 to #123456FF
353355
if (strlen($tmp) % 3 == 0) {
354356
$mult = strlen($tmp) / 3;
355357
$hex .= str_repeat("f", $mult);

0 commit comments

Comments
 (0)