We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4a3e40 commit df067f3Copy full SHA for df067f3
webapp/src/Twig/TwigExtension.php
@@ -1193,11 +1193,7 @@ private function hexToForegroundAndBorder(string $rgb): array
1193
$contrastWithWhite = $this->apcaContrast('#ffffff', $rgb);
1194
$contrastWithBlack = $this->apcaContrast('#000000', $rgb);
1195
1196
- if (abs($contrastWithBlack) > abs($contrastWithWhite)) {
1197
- $foreground = '#000000';
1198
- } else {
1199
- $foreground = '#ffffff';
1200
- }
+ $foreground = (abs($contrastWithBlack) > abs($contrastWithWhite)) ? '#000000' : '#ffffff';
1201
1202
return [$foreground, $border];
1203
}
0 commit comments