Loading Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ ARG USER_MIGRATION_JOB_ID="974383" ARG MEMORIES_VERSION="7.3.1" ARG DROP_ACCOUNT_VERSION="2.5.0" RUN sed -i 's/28,0,8,1/28,0,8,6/' ${BASE_DIR}/version.php RUN sed -i 's/28,0,8,1/28,0,8,7/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images Loading patches/026-primary-color-fix.patch +8 −27 Original line number Diff line number Diff line Loading @@ -17,31 +17,12 @@ Subject: [PATCH] To fix the primary color in nextcloud 25 onwards --- apps/theming/lib/Util.php 2024-08-02 10:10:38 +++ apps/theming/lib/Util-new.php 2024-08-02 10:11:41 @@ -82,28 +82,6 @@ * @return string @@ -57,7 +57,7 @@ * @return bool */ public function elementColor($color, ?bool $brightBackground = null, ?string $backgroundColor = null, bool $highContrast = false) { - if ($backgroundColor !== null) { - $brightBackground = $brightBackground ?? $this->isBrightColor($backgroundColor); - // Minimal amount that is possible to change the luminance - $epsilon = 1.0 / 255.0; - // Current iteration to prevent infinite loops - $iteration = 0; - // We need to keep blurred backgrounds in mind which might be mixed with the background - $blurredBackground = $this->mix($backgroundColor, $brightBackground ? $color : '#ffffff', 66); - $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; - - while ($contrast < $minContrast && $iteration++ < 100) { - $hsl = Color::hexToHsl($color); - $hsl['L'] = max(0, min(1, $hsl['L'] + ($brightBackground ? -$epsilon : $epsilon))); - $color = '#' . Color::hslToHex($hsl); - $contrast = $this->colorContrast($color, $blurredBackground); - } - return $color; - } - // Fallback for legacy calling $luminance = $this->calculateLuminance($color); public function invertTextColor(string $color): bool { - return $this->colorContrast($color, '#ffffff') < 4.5; + return $this->isBrightColor($color); } /** Loading
Dockerfile +1 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,7 @@ ARG USER_MIGRATION_JOB_ID="974383" ARG MEMORIES_VERSION="7.3.1" ARG DROP_ACCOUNT_VERSION="2.5.0" RUN sed -i 's/28,0,8,1/28,0,8,6/' ${BASE_DIR}/version.php RUN sed -i 's/28,0,8,1/28,0,8,7/' ${BASE_DIR}/version.php COPY custom_entrypoint.sh / RUN chmod +x /custom_entrypoint.sh RUN mkdir -p /var/www/skeleton/Documents && mkdir -p /var/www/skeleton/Images Loading
patches/026-primary-color-fix.patch +8 −27 Original line number Diff line number Diff line Loading @@ -17,31 +17,12 @@ Subject: [PATCH] To fix the primary color in nextcloud 25 onwards --- apps/theming/lib/Util.php 2024-08-02 10:10:38 +++ apps/theming/lib/Util-new.php 2024-08-02 10:11:41 @@ -82,28 +82,6 @@ * @return string @@ -57,7 +57,7 @@ * @return bool */ public function elementColor($color, ?bool $brightBackground = null, ?string $backgroundColor = null, bool $highContrast = false) { - if ($backgroundColor !== null) { - $brightBackground = $brightBackground ?? $this->isBrightColor($backgroundColor); - // Minimal amount that is possible to change the luminance - $epsilon = 1.0 / 255.0; - // Current iteration to prevent infinite loops - $iteration = 0; - // We need to keep blurred backgrounds in mind which might be mixed with the background - $blurredBackground = $this->mix($backgroundColor, $brightBackground ? $color : '#ffffff', 66); - $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; - - while ($contrast < $minContrast && $iteration++ < 100) { - $hsl = Color::hexToHsl($color); - $hsl['L'] = max(0, min(1, $hsl['L'] + ($brightBackground ? -$epsilon : $epsilon))); - $color = '#' . Color::hslToHex($hsl); - $contrast = $this->colorContrast($color, $blurredBackground); - } - return $color; - } - // Fallback for legacy calling $luminance = $this->calculateLuminance($color); public function invertTextColor(string $color): bool { - return $this->colorContrast($color, '#ffffff') < 4.5; + return $this->isBrightColor($color); } /**