We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc07627 commit b9ef482Copy full SHA for b9ef482
apps/theming/lib/IconBuilder.php
@@ -234,7 +234,14 @@ public function colorSvg($app, $image) {
234
}
235
$svg = file_get_contents($imageFile);
236
if ($svg !== false && $svg !== "") {
237
- $color = $this->util->elementColor($this->themingDefaults->getColorPrimary());
+ $primaryColor = $this->themingDefaults->getColorPrimary();
238
+ $luminance = $this->util->calculateLuminance($primaryColor);
239
+ if ($luminance > 0.8) {
240
+ $isBrightColor = true;
241
+ } elseif ($luminance < 0.2) {
242
+ $isBrightColor = false;
243
+ }
244
+ $color = $this->util->elementColor($primaryColor, $isBrightColor);
245
$svg = $this->util->colorizeSvg($svg, $color);
246
return $svg;
247
} else {
0 commit comments