From: Lukas Reschke Date: Fri, 4 Aug 2017 13:38:56 +0000 (+0200) Subject: Revert "[stable12] theming lightness correction" X-Git-Tag: v12.0.1RC5^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fpull%2F5983%2Fhead;p=nextcloud-server.git Revert "[stable12] theming lightness correction" --- diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php index e5fa90cb344..286756a4849 100644 --- a/apps/theming/lib/Util.php +++ b/apps/theming/lib/Util.php @@ -30,7 +30,6 @@ use OCP\Files\NotFoundException; use OCP\Files\SimpleFS\ISimpleFile; use OCP\IConfig; use OCP\Files\IRootFolder; -use Leafo\ScssPhp\Compiler; class Util { @@ -96,12 +95,10 @@ class Util { if (strlen($hex) !== 6) { return 0; } - $red = hexdec(substr($hex, 0, 2)); - $green = hexdec(substr($hex, 2, 2)); - $blue = hexdec(substr($hex, 4, 2)); - $compiler = new Compiler(); - $hsl = $compiler->toHSL($red, $green, $blue); - return $hsl[3]/100; + $r = hexdec(substr($hex, 0, 2)); + $g = hexdec(substr($hex, 2, 2)); + $b = hexdec(substr($hex, 4, 2)); + return (0.299 * $r + 0.587 * $g + 0.114 * $b)/255; } /**