Fixed light/dark color correction

This commit is contained in:
M66B
2022-08-02 15:17:01 +02:00
parent 88807906fa
commit 07a0192b23

View File

@@ -750,7 +750,7 @@ public class HtmlHelper {
// Special case:
// external draft: very dark/light font
double lum = ColorUtils.calculateLuminance(color);
if (lum < MIN_LUMINANCE_COMPOSE || lum > 1 - MIN_LUMINANCE_COMPOSE)
if (dark ? lum < 1 - MIN_LUMINANCE_COMPOSE : lum > MIN_LUMINANCE_COMPOSE)
color = null;
}
@@ -761,7 +761,7 @@ public class HtmlHelper {
// Background color was suppressed because "no color"
if (color != null) {
double lum = ColorUtils.calculateLuminance(color);
if (dark ? lum < MIN_LUMINANCE_VIEW : lum > 1 - MIN_LUMINANCE_VIEW)
if (dark ? lum < 1 - MIN_LUMINANCE_VIEW : lum > MIN_LUMINANCE_VIEW)
color = textColorPrimary;
}
}