Skip to content

Commit

Permalink
try to fix too dark or bright themed icons
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed May 9, 2023
1 parent fc07627 commit aa0c5ea
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/theming/lib/IconBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,13 @@ public function colorSvg($app, $image) {
}
$svg = file_get_contents($imageFile);
if ($svg !== false && $svg !== "") {
$color = $this->util->elementColor($this->themingDefaults->getColorPrimary());
$primaryColor = $this->themingDefaults->getColorPrimary();
$luminance = $this->util->calculateLuminance($primaryColor);
$isBrightColor = false;
if ($luminance > 0.8) {
$isBrightColor = true;
}
$color = $this->util->elementColor($primaryColor, $isBrightColor);
$svg = $this->util->colorizeSvg($svg, $color);
return $svg;
} else {
Expand Down

0 comments on commit aa0c5ea

Please sign in to comment.