diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-08-04 16:39:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-04 16:39:15 +0300 |
commit | b500f8fbe9cdbd7cecb7ec951bdc0fb50d3687d4 (patch) | |
tree | 9fdffe0cb7bb3bc1c9159d55a709a1f758ad618e | |
parent | 9b57d33631f68460001b9574e05eac182d4310ed (diff) | |
parent | 3474d73caed3947caca5458d607fd3d58d98b5ab (diff) |
Merge pull request #5983 from nextcloud/revert-5977-stable12-theming-lightness-correctionv12.0.1RC5
Revert "[stable12] theming lightness correction"
-rw-r--r-- | apps/theming/lib/Util.php | 11 |
1 files changed, 4 insertions, 7 deletions
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; } /** |