diff --git a/app/src/main/java/eu/faircode/email/FragmentCompose.java b/app/src/main/java/eu/faircode/email/FragmentCompose.java index 1b16e43c10..0a7f4a5759 100644 --- a/app/src/main/java/eu/faircode/email/FragmentCompose.java +++ b/app/src/main/java/eu/faircode/email/FragmentCompose.java @@ -355,6 +355,9 @@ public class FragmentCompose extends FragmentBase { lt_enabled = LanguageTool.isEnabled(context); lt_auto = LanguageTool.isAuto(context); + if (compose_color != Color.TRANSPARENT && Helper.isDarkTheme(context)) + compose_color = HtmlHelper.adjustLuminance(compose_color, true, HtmlHelper.MIN_LUMINANCE_COMPOSE); + setTitle(R.string.page_compose); setSubtitle(getResources().getQuantityString(R.plurals.page_message, 1)); } diff --git a/app/src/main/java/eu/faircode/email/HtmlHelper.java b/app/src/main/java/eu/faircode/email/HtmlHelper.java index 5459eb8c0a..5be1aea547 100644 --- a/app/src/main/java/eu/faircode/email/HtmlHelper.java +++ b/app/src/main/java/eu/faircode/email/HtmlHelper.java @@ -141,12 +141,13 @@ public class HtmlHelper { static final int MAX_SHARE_TEXT_SIZE = 50 * 1024; // characters static final int MAX_TRANSLATABLE_TEXT_SIZE = 50 * 1024; // characters + static final float MIN_LUMINANCE_VIEW = 0.7f; + static final float MIN_LUMINANCE_COMPOSE = 0.85f; + private static final int DEFAULT_FONT_SIZE = 16; // pixels private static final int DEFAULT_FONT_SIZE_PT = 12; // points private static final int GRAY_THRESHOLD = Math.round(255 * 0.2f); private static final int COLOR_THRESHOLD = Math.round(255 * 0.1f); - private static final float MIN_LUMINANCE_VIEW = 0.7f; - private static final float MIN_LUMINANCE_COMPOSE = 0.85f; private static final int TAB_SIZE = 4; private static final int MAX_ALT = 250; private static final int MAX_AUTO_LINK = 250;