Theming: Invert app icon in favicon for bright backgrounds

fixes #5650

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2017-09-12 11:35:02 +02:00
parent 1f8a3e05c1
commit 9a47b25f19
No known key found for this signature in database
GPG Key ID: 4C614C6ED2CDE6DF
1 changed files with 11 additions and 0 deletions

View File

@ -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();