aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/lib
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2024-01-20 07:43:04 +0100
committerFerdinand Thiessen <opensource@fthiessen.de>2024-05-21 20:36:26 +0200
commit538a04968a24f645b12ca2647952a5b73ebc3eac (patch)
treefe6de92830c3cab15b8e2ea96e473566267726c7 /apps/theming/lib
parent11dbfa636d746eac4a82460d0677dc6ffe98f068 (diff)
downloadnextcloud-server-538a04968a24f645b12ca2647952a5b73ebc3eac.tar.gz
nextcloud-server-538a04968a24f645b12ca2647952a5b73ebc3eac.zip
fix(tests): Adjust theming test for new splitted background and primary colors
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r--apps/theming/lib/Service/BackgroundService.php5
-rw-r--r--apps/theming/lib/Themes/CommonThemeTrait.php3
-rw-r--r--apps/theming/lib/Util.php2
3 files changed, 5 insertions, 5 deletions
diff --git a/apps/theming/lib/Service/BackgroundService.php b/apps/theming/lib/Service/BackgroundService.php
index c323a721b60..cdaff2372a8 100644
--- a/apps/theming/lib/Service/BackgroundService.php
+++ b/apps/theming/lib/Service/BackgroundService.php
@@ -43,7 +43,7 @@ use OCP\Lock\LockedException;
use OCP\PreConditionNotMetException;
class BackgroundService {
- public const DEFAULT_COLOR = '#0082c9';
+ public const DEFAULT_COLOR = '#00679e';
public const DEFAULT_BACKGROUND_COLOR = '#00679e';
/**
@@ -300,9 +300,10 @@ class BackgroundService {
$meanColor = $this->calculateMeanColor($image);
if ($meanColor !== false) {
$this->config->setAppValue(Application::APP_ID, 'background_color', $meanColor);
+ return $meanColor;
}
- return $meanColor;
}
+ return null;
}
/**
diff --git a/apps/theming/lib/Themes/CommonThemeTrait.php b/apps/theming/lib/Themes/CommonThemeTrait.php
index bdf95d98275..f2d86009cef 100644
--- a/apps/theming/lib/Themes/CommonThemeTrait.php
+++ b/apps/theming/lib/Themes/CommonThemeTrait.php
@@ -61,7 +61,6 @@ trait CommonThemeTrait {
'--primary-invert-if-dark' => $this->util->invertTextColor($colorPrimaryElement) ? 'no' : 'invert(100%)',
'--color-primary' => $this->primaryColor,
- '--color-primary-default' => $this->defaultPrimaryColor,
'--color-primary-text' => $this->util->invertTextColor($this->primaryColor) ? '#000000' : '#ffffff',
'--color-primary-hover' => $this->util->mix($this->primaryColor, $colorMainBackground, 60),
'--color-primary-light' => $colorPrimaryLight,
@@ -105,7 +104,7 @@ trait CommonThemeTrait {
if ($this->imageManager->hasImage($image)) {
$imageUrl = $this->imageManager->getImageUrl($image);
$variables["--image-$image"] = "url('" . $imageUrl . "')";
- } else if ($image === 'background') {
+ } elseif ($image === 'background') {
// Apply default background if nothing is configured
$variables['--image-background'] = "url('" . $this->themingDefaults->getBackground() . "')";
}
diff --git a/apps/theming/lib/Util.php b/apps/theming/lib/Util.php
index a2f8ee0abad..5dd71c1c1d3 100644
--- a/apps/theming/lib/Util.php
+++ b/apps/theming/lib/Util.php
@@ -93,7 +93,7 @@ class Util {
$contrast = $this->colorContrast($color, $blurredBackground);
// Min. element contrast is 3:1 but we need to keep hover states in mind -> min 3.2:1
- $minContrast = $highContrast ? 5.5 : 3.2;
+ $minContrast = $highContrast ? 5.6 : 3.2;
while ($contrast < $minContrast && $iteration++ < 100) {
$hsl = Color::hexToHsl($color);