@@ -88,13 +88,13 @@ protected function generatePrimaryVariables(string $colorMainBackground, string
8888 protected function generateGlobalBackgroundVariables (): array {
8989 $ backgroundDeleted = $ this ->config ->getAppValue (Application::APP_ID , 'backgroundMime ' , '' ) === 'backgroundColor ' ;
9090 $ hasCustomLogoHeader = $ this ->util ->isLogoThemed ();
91- $ isPrimaryBright = $ this ->util ->invertTextColor ($ this ->primaryColor );
91+ $ isDefaultPrimaryBright = $ this ->util ->invertTextColor ($ this ->defaultPrimaryColor );
9292
9393 $ variables = [];
9494
9595 // Default last fallback values
9696 $ variables ['--image-background-default ' ] = "url(' " . $ this ->themingDefaults ->getBackground () . "') " ;
97- $ variables ['--color-background-plain ' ] = $ this ->primaryColor ;
97+ $ variables ['--color-background-plain ' ] = $ this ->defaultPrimaryColor ;
9898
9999 // Register image variables only if custom-defined
100100 foreach (ImageManager::SUPPORTED_IMAGE_KEYS as $ image ) {
@@ -108,11 +108,11 @@ protected function generateGlobalBackgroundVariables(): array {
108108 // If primary as background has been request or if we have a custom primary colour
109109 // let's not define the background image
110110 if ($ backgroundDeleted ) {
111- $ variables ['--color-background-plain ' ] = $ this ->primaryColor ;
111+ $ variables ['--color-background-plain ' ] = $ this ->defaultPrimaryColor ;
112112 $ variables ['--image-background-plain ' ] = 'yes ' ;
113113 $ variables ['--image-background ' ] = 'no ' ;
114114 // If no background image is set, we need to check against the shown primary colour
115- $ variables ['--background-image-invert-if-bright ' ] = $ isPrimaryBright ? 'invert(100%) ' : 'no ' ;
115+ $ variables ['--background-image-invert-if-bright ' ] = $ isDefaultPrimaryBright ? 'invert(100%) ' : 'no ' ;
116116 }
117117
118118 if ($ hasCustomLogoHeader ) {
@@ -133,14 +133,14 @@ protected function generateUserBackgroundVariables(): array {
133133 $ adminBackgroundDeleted = $ this ->config ->getAppValue (Application::APP_ID , 'backgroundMime ' , '' ) === 'backgroundColor ' ;
134134 $ backgroundImage = $ this ->config ->getUserValue ($ user ->getUID (), Application::APP_ID , 'background_image ' , BackgroundService::BACKGROUND_DEFAULT );
135135 $ currentVersion = (int )$ this ->config ->getUserValue ($ user ->getUID (), Application::APP_ID , 'userCacheBuster ' , '0 ' );
136- $ isPrimaryBright = $ this ->util ->invertTextColor ($ this ->primaryColor );
136+ $ isPrimaryBright = $ this ->util ->invertTextColor ($ this ->themingDefaults -> getColorPrimary () );
137137
138138 // The user removed the background
139139 if ($ backgroundImage === BackgroundService::BACKGROUND_DISABLED ) {
140140 return [
141141 // Might be defined already by admin theming, needs to be overridden
142142 '--image-background ' => 'none ' ,
143- '--color-background-plain ' => $ this ->primaryColor ,
143+ '--color-background-plain ' => $ this ->themingDefaults -> getColorPrimary () ,
144144 // If no background image is set, we need to check against the shown primary colour
145145 '--background-image-invert-if-bright ' => $ isPrimaryBright ? 'invert(100%) ' : 'no ' ,
146146 ];
@@ -151,15 +151,15 @@ protected function generateUserBackgroundVariables(): array {
151151 $ cacheBuster = substr (sha1 ($ user ->getUID () . '_ ' . $ currentVersion ), 0 , 8 );
152152 return [
153153 '--image-background ' => "url(' " . $ this ->urlGenerator ->linkToRouteAbsolute ('theming.userTheme.getBackground ' ) . "?v= $ cacheBuster') " ,
154- '--color-background-plain ' => $ this ->primaryColor ,
154+ '--color-background-plain ' => $ this ->themingDefaults -> getColorPrimary () ,
155155 ];
156156 }
157157
158158 // The user is using the default background and admin removed the background image
159159 if ($ backgroundImage === BackgroundService::BACKGROUND_DEFAULT && $ adminBackgroundDeleted ) {
160160 return [
161161 // --image-background is not defined in this case
162- '--color-background-plain ' => $ this ->primaryColor ,
162+ '--color-background-plain ' => $ this ->themingDefaults -> getColorPrimary () ,
163163 '--background-image-invert-if-bright ' => $ isPrimaryBright ? 'invert(100%) ' : 'no ' ,
164164 ];
165165 }
@@ -168,7 +168,7 @@ protected function generateUserBackgroundVariables(): array {
168168 if (isset (BackgroundService::SHIPPED_BACKGROUNDS [$ backgroundImage ])) {
169169 return [
170170 '--image-background ' => "url(' " . $ this ->urlGenerator ->linkTo (Application::APP_ID , "img/background/ $ backgroundImage " ) . "') " ,
171- '--color-background-plain ' => $ this ->primaryColor ,
171+ '--color-background-plain ' => $ this ->themingDefaults -> getColorPrimary () ,
172172 '--background-image-invert-if-bright ' => BackgroundService::SHIPPED_BACKGROUNDS [$ backgroundImage ]['theming ' ] ?? null === BackgroundService::THEMING_MODE_DARK ? 'invert(100%) ' : 'no ' ,
173173 ];
174174 }
0 commit comments