mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-27 11:25:13 +01:00
Fixed light/dark color correction
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user