aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/theming/lib/Util.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php
index f5321dada67..41ded251b0b 100644
--- a/apps/theming/lib/Util.php
+++ b/apps/theming/lib/Util.php
@@ -78,18 +78,18 @@ class Util {
* get color for on-page elements:
* theme color by default, grey if theme color is to bright
* @param string $color
- * @param bool $brightBackground
+ * @param ?bool $brightBackground
* @return string
*/
- public function elementColor($color, bool $brightBackground = true) {
+ public function elementColor($color, ?bool $brightBackground = null) {
$luminance = $this->calculateLuminance($color);
- if ($brightBackground && $luminance > 0.8) {
+ if ($brightBackground !== false && $luminance > 0.8) {
// If the color is too bright in bright mode, we fall back to a darker gray
return '#aaaaaa';
}
- if (!$brightBackground && $luminance < 0.2) {
+ if ($brightBackground !== true && $luminance < 0.2) {
// If the color is too dark in dark mode, we fall back to a brighter gray
return '#8c8c8c';
}