summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2017-09-12 11:35:02 +0200
committerJulius Härtl <jus@bitgrid.net>2017-09-12 11:37:25 +0200
commit9a47b25f190a17010eab6a488c2070d42cc13cf8 (patch)
tree3c6b2c3826c231c6f3670efba1a1f6db72ce5738 /apps/theming
parent1f8a3e05c166d6ab1c216630787795df74817a15 (diff)
downloadnextcloud-server-9a47b25f190a17010eab6a488c2070d42cc13cf8.tar.gz
nextcloud-server-9a47b25f190a17010eab6a488c2070d42cc13cf8.zip
Theming: Invert app icon in favicon for bright backgrounds
fixes #5650 Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/IconBuilder.php11
1 files changed, 11 insertions, 0 deletions
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();