diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-22 18:47:41 +0100 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-01-23 01:01:42 +0100 |
commit | 8de89b210358275a60576773175964fded72989d (patch) | |
tree | 5ee27aa58eb9ee3b8d61400a55af6f2df3fc5ada /apps/theming/lib | |
parent | 64ccc1ef87f095957bb6d169d7099e8c1976bf67 (diff) | |
download | nextcloud-server-8de89b210358275a60576773175964fded72989d.tar.gz nextcloud-server-8de89b210358275a60576773175964fded72989d.zip |
fix(theming): Apply same logic on capabilities for primary color like on themes
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/theming/lib')
-rw-r--r-- | apps/theming/lib/Capabilities.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/theming/lib/Capabilities.php b/apps/theming/lib/Capabilities.php index e19665ffb31..b0c6a71731b 100644 --- a/apps/theming/lib/Capabilities.php +++ b/apps/theming/lib/Capabilities.php @@ -94,7 +94,11 @@ class Capabilities implements IPublicCapability { */ public function getCapabilities() { $color = $this->theming->getDefaultColorPrimary(); - $colorText = $this->theming->getDefaultTextColorPrimary(); + // Same as in DefaultTheme + if ($color === BackgroundService::DEFAULT_COLOR) { + $color = BackgroundService::DEFAULT_ACCESSIBLE_COLOR; + } + $colorText = $this->util->invertTextColor($color) ? '#000000' : '#ffffff'; $backgroundLogo = $this->config->getAppValue('theming', 'backgroundMime', ''); $backgroundPlain = $backgroundLogo === 'backgroundColor' || ($backgroundLogo === '' && $color !== '#0082c9'); @@ -108,7 +112,10 @@ class Capabilities implements IPublicCapability { * @see \OCA\Theming\Themes\CommonThemeTrait::generateUserBackgroundVariables() */ $color = $this->theming->getColorPrimary(); - $colorText = $this->theming->getTextColorPrimary(); + if ($color === BackgroundService::DEFAULT_COLOR) { + $color = BackgroundService::DEFAULT_ACCESSIBLE_COLOR; + } + $colorText = $this->util->invertTextColor($color) ? '#000000' : '#ffffff'; $backgroundImage = $this->config->getUserValue($user->getUID(), Application::APP_ID, 'background_image', BackgroundService::BACKGROUND_DEFAULT); if ($backgroundImage === BackgroundService::BACKGROUND_CUSTOM) { |