summaryrefslogtreecommitdiffstats
path: root/apps/theming
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-09-13 10:48:33 +0200
committerGitHub <noreply@github.com>2017-09-13 10:48:33 +0200
commit241579587a6ce66a1eab52339d48d35c8051978b (patch)
tree337c3f9d3424521afacf678db6f2ce2365d79616 /apps/theming
parent5ce3c7003ba754003d79624aac26e6dbc19936d7 (diff)
parent9a47b25f190a17010eab6a488c2070d42cc13cf8 (diff)
downloadnextcloud-server-241579587a6ce66a1eab52339d48d35c8051978b.tar.gz
nextcloud-server-241579587a6ce66a1eab52339d48d35c8051978b.zip
Merge pull request #6457 from nextcloud/theming-favicon-invert-apps
Invert themed favicons on bright colors
Diffstat (limited to 'apps/theming')
-rw-r--r--apps/theming/lib/IconBuilder.php17
1 files changed, 13 insertions, 4 deletions
diff --git a/apps/theming/lib/IconBuilder.php b/apps/theming/lib/IconBuilder.php
index 4383ccc7cd9..d0e26e110fc 100644
--- a/apps/theming/lib/IconBuilder.php
+++ b/apps/theming/lib/IconBuilder.php
@@ -58,7 +58,7 @@ class IconBuilder {
if ($icon === false) {
return false;
}
- $icon->setImageFormat("png24");
+ $icon->setImageFormat("png32");
$data = $icon->getImageBlob();
$icon->destroy();
return $data;
@@ -77,7 +77,7 @@ class IconBuilder {
if ($icon === false) {
return false;
}
- $icon->setImageFormat("png24");
+ $icon->setImageFormat("png32");
$data = $icon->getImageBlob();
$icon->destroy();
return $data;
@@ -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();
@@ -162,8 +173,6 @@ class IconBuilder {
$offset_w = 512 / 2 - $innerWidth / 2;
$offset_h = 512 / 2 - $innerHeight / 2;
- $appIconFile->setImageFormat("png24");
-
$finalIconFile = new Imagick();
$finalIconFile->setBackgroundColor(new ImagickPixel('transparent'));
$finalIconFile->readImageBlob($background);