From 9a47b25f190a17010eab6a488c2070d42cc13cf8 Mon Sep 17 00:00:00 2001 From: Julius Härtl Date: Tue, 12 Sep 2017 11:35:02 +0200 Subject: Theming: Invert app icon in favicon for bright backgrounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes #5650 Signed-off-by: Julius Härtl --- apps/theming/lib/IconBuilder.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php index 5d1c58e93f2..d0e26e110fc 100644 --- a/apps/theming/lib/IconBuilder.php +++ b/apps/theming/lib/IconBuilder.php @@ -145,6 +145,17 @@ class IconBuilder { $appIconFile->setResolution($resX, $resY); $appIconFile->setBackgroundColor(new ImagickPixel('transparent')); $appIconFile->readImageBlob($svg); + + /** + * invert app icons for bright primary colors + * the default nextcloud logo will not be inverted to black + */ + if ($this->util->invertTextColor($color) + && !$appIcon instanceof ISimpleFile + && $app !== "core" + ) { + $appIconFile->negateImage(false); + } $appIconFile->scaleImage(512, 512, true); } else { $appIconFile = new Imagick(); -- cgit v1.2.3