Skip to content

Commit df067f3

Browse files
nickygerritsenvmcj
andauthored
Update webapp/src/Twig/TwigExtension.php
Co-authored-by: MCJ Vasseur <[email protected]>
1 parent b4a3e40 commit df067f3

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

webapp/src/Twig/TwigExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,11 +1193,7 @@ private function hexToForegroundAndBorder(string $rgb): array
11931193
$contrastWithWhite = $this->apcaContrast('#ffffff', $rgb);
11941194
$contrastWithBlack = $this->apcaContrast('#000000', $rgb);
11951195

1196-
if (abs($contrastWithBlack) > abs($contrastWithWhite)) {
1197-
$foreground = '#000000';
1198-
} else {
1199-
$foreground = '#ffffff';
1200-
}
1196+
$foreground = (abs($contrastWithBlack) > abs($contrastWithWhite)) ? '#000000' : '#ffffff';
12011197

12021198
return [$foreground, $border];
12031199
}

0 commit comments

Comments
 (0)