Reduce white brightness in dark mode

pull/935/head
Alex Baker 5 years ago
parent 065c38403f
commit 107e0fd31a

@ -84,8 +84,8 @@ public class ThemeCache {
widgetBackgroundNames[i], widgetBackgroundNames[i],
i, i,
getColor(context, WidgetTheme.BACKGROUNDS[i]), getColor(context, WidgetTheme.BACKGROUNDS[i]),
getColor(context, i == 0 ? R.color.black_87 : R.color.white_100), getColor(context, i == 0 ? R.color.black_87 : R.color.white_87),
getColor(context, i == 0 ? R.color.black_54 : R.color.white_70))); getColor(context, i == 0 ? R.color.black_54 : R.color.white_60)));
} }
untaggedColor = untaggedColor =
new ThemeColor(context, 19, getColor(context, R.color.tag_color_none_background)); new ThemeColor(context, 19, getColor(context, R.color.tag_color_none_background));

@ -142,7 +142,7 @@ public class ThemeColor implements Pickable {
this.colorPrimary = colorPrimary; this.colorPrimary = colorPrimary;
this.colorPrimaryVariant = ColorUtil.darken(colorPrimary, 12); this.colorPrimaryVariant = ColorUtil.darken(colorPrimary, 12);
int whiteText = context.getResources().getColor(R.color.white_100); int whiteText = context.getResources().getColor(R.color.white_87);
double contrast = ColorUtils.calculateContrast(whiteText, colorPrimary); double contrast = ColorUtils.calculateContrast(whiteText, colorPrimary);
this.isDark = contrast < 3; this.isDark = contrast < 3;
colorOnPrimary = isDark ? context.getResources().getColor(R.color.black_87) : whiteText; colorOnPrimary = isDark ? context.getResources().getColor(R.color.black_87) : whiteText;

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/white_50" android:state_enabled="false"/> <item android:color="@color/white_38" android:state_enabled="false"/>
<item android:color="@color/white_100"/> <item android:color="@color/white_87"/>
</selector> </selector>

@ -7,7 +7,7 @@
<color name="icon_tint_with_alpha">@color/icon_tint_dark_alpha</color> <color name="icon_tint_with_alpha">@color/icon_tint_dark_alpha</color>
<color name="drawer_color">@color/md_background_dark</color> <color name="drawer_color">@color/md_background_dark</color>
<color name="drawer_color_selected">@color/drawer_background_dark_selected</color> <color name="drawer_color_selected">@color/drawer_background_dark_selected</color>
<color name="text_secondary">@color/white_70</color> <color name="text_secondary">@color/white_60</color>
<color name="text_tertiary">@color/white_50</color> <color name="text_tertiary">@color/white_38</color>
<color name="overdue">@color/overdue_87</color> <color name="overdue">@color/overdue_87</color>
</resources> </resources>

@ -86,8 +86,9 @@
<color name="black_12">#1f000000</color> <color name="black_12">#1f000000</color>
<color name="white_100">#ffffffff</color> <color name="white_100">#ffffffff</color>
<color name="white_70">#b3ffffff</color> <color name="white_87">#deffffff</color>
<color name="white_50">#80ffffff</color> <color name="white_60">#99ffffff</color>
<color name="white_38">#61ffffff</color>
<color name="white_12">#1fffffff</color> <color name="white_12">#1fffffff</color>
<color name="overdue_87">#def44336</color> <color name="overdue_87">#def44336</color>
@ -99,7 +100,7 @@
<color name="icon_tint_light">@android:color/black</color> <color name="icon_tint_light">@android:color/black</color>
<color name="icon_tint_dark">@android:color/white</color> <color name="icon_tint_dark">@android:color/white</color>
<color name="icon_tint_light_alpha">@color/black_54</color> <color name="icon_tint_light_alpha">@color/black_54</color>
<color name="icon_tint_dark_alpha">@color/white_70</color> <color name="icon_tint_dark_alpha">@color/white_60</color>
<color name="drawer_background_light_selected">#e8e8e8</color> <color name="drawer_background_light_selected">#e8e8e8</color>
<color name="drawer_background_dark_selected">#303030</color> <color name="drawer_background_dark_selected">#303030</color>
@ -109,7 +110,7 @@
<color name="priority_3">@color/blue_500</color> <color name="priority_3">@color/blue_500</color>
<color name="priority_4">@color/grey_500</color> <color name="priority_4">@color/grey_500</color>
<color name="snackbar_text_color">@color/white_100</color> <color name="snackbar_text_color">@color/white_87</color>
<color name="snackbar_action_color">#f4b400</color> <color name="snackbar_action_color">#f4b400</color>
<color name="snackbar_background">@color/grey_800</color> <color name="snackbar_background">@color/grey_800</color>
<color name="tag_color_none_background">#e1e1e1</color> <color name="tag_color_none_background">#e1e1e1</color>

@ -28,8 +28,8 @@
<style name="WhiteToolbarTheme"> <style name="WhiteToolbarTheme">
<item name="overlay_theme">@style/WhiteToolbarOverlay</item> <item name="overlay_theme">@style/WhiteToolbarOverlay</item>
<item name="colorOnPrimary">@color/white_100</item> <item name="colorOnPrimary">@color/white_87</item>
<item name="colorOnPrimaryHint">@color/white_70</item> <item name="colorOnPrimaryHint">@color/white_60</item>
<item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item> <item name="android:actionOverflowButtonStyle">@style/WhiteOverflow</item>
</style> </style>
@ -41,7 +41,7 @@
</style> </style>
<style name="WhiteTint"> <style name="WhiteTint">
<item name="colorOnSecondary">@color/white_100</item> <item name="colorOnSecondary">@color/white_87</item>
</style> </style>
<style name="BlackTint"> <style name="BlackTint">
@ -49,7 +49,7 @@
</style> </style>
<style name="WhiteOverflow" parent="Widget.AppCompat.Light.ActionButton.Overflow"> <style name="WhiteOverflow" parent="Widget.AppCompat.Light.ActionButton.Overflow">
<item name="android:tint">@color/white_100</item> <item name="android:tint">@color/white_87</item>
</style> </style>
<style name="BlackOverflow" parent="Widget.AppCompat.Light.ActionButton.Overflow"> <style name="BlackOverflow" parent="Widget.AppCompat.Light.ActionButton.Overflow">
@ -57,9 +57,9 @@
</style> </style>
<style name="WhiteToolbarOverlay" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"> <style name="WhiteToolbarOverlay" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">
<item name="colorControlNormal">@color/white_100</item> <item name="colorControlNormal">@color/white_87</item>
<item name="android:textColorHint">@color/white_100</item> <item name="android:textColorHint">@color/white_60</item>
<item name="android:editTextColor">@color/white_100</item> <item name="android:editTextColor">@color/white_87</item>
</style> </style>
<style name="BlackToolbarOverlay" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar"> <style name="BlackToolbarOverlay" parent="@style/ThemeOverlay.MaterialComponents.Dark.ActionBar">

Loading…
Cancel
Save