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 6bcd663 commit ca47442Copy full SHA for ca47442
webapp/src/Twig/TwigExtension.php
@@ -1165,6 +1165,7 @@ private function hexToForegroundAndBorder(string $rgb): array
1165
[$r, $g, $b] = $background;
1166
1167
// Calculate relative luminance
1168
+ // Source: https://www.w3.org/WAI/GL/wiki/Relative_luminance
1169
$r = ($r / 255 <= 0.03928) ? ($r / 255) / 12.92 : pow(($r / 255 + 0.055) / 1.055, 2.4);
1170
$g = ($g / 255 <= 0.03928) ? ($g / 255) / 12.92 : pow(($g / 255 + 0.055) / 1.055, 2.4);
1171
$b = ($b / 255 <= 0.03928) ? ($b / 255) / 12.92 : pow(($b / 255 + 0.055) / 1.055, 2.4);
0 commit comments