Added desatuated color

This commit is contained in:
h4h13 2019-10-12 12:11:48 +05:30
parent b73fb9dbc3
commit df8a9c447e
7 changed files with 40 additions and 6 deletions

View file

@ -206,8 +206,9 @@ private constructor(private val mContext: Context) : ThemeStorePrefKeys, ThemeSt
@CheckResult
@ColorInt
fun accentColor(context: Context): Int {
val desaturatedColor = prefs(context).getBoolean("desaturated_color", false)
val color = prefs(context).getInt(ThemeStorePrefKeys.KEY_ACCENT_COLOR, ATHUtil.resolveColor(context, R.attr.colorAccent, Color.parseColor("#263238")))
return if (ATHUtil.isWindowBackgroundDark(context)) ColorUtil.desaturateColor(color, 0.4f) else color
return if (ATHUtil.isWindowBackgroundDark(context) && desaturatedColor) ColorUtil.desaturateColor(color, 0.4f) else color
}
@CheckResult