aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-18 20:25:26 -0700
committerGitHub <noreply@github.com>2017-08-18 20:25:26 -0700
commitede53aff0ca989881247afead959341818f705b4 (patch)
tree4cafcf203bac331ebc53eab690c0fb41813d23da /app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
parent22df6cd1cf436433d5e381a6d6e694a91f647075 (diff)
downloadfrost-ede53aff0ca989881247afead959341818f705b4.tar.gz
frost-ede53aff0ca989881247afead959341818f705b4.tar.bz2
frost-ede53aff0ca989881247afead959341818f705b4.zip
Feature/theme accent (#192)
* Add lots of theming components * Optimize and add * Update accents
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt17
1 files changed, 5 insertions, 12 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
index 9b8064a4..27405026 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Prefs.kt
@@ -26,6 +26,8 @@ object Prefs : KPref() {
var customTextColor: Int by kpref("color_text", 0xffeceff1.toInt())
+ var customAccentColor: Int by kpref("color_accent", 0xff0288d1.toInt())
+
var customBackgroundColor: Int by kpref("color_bg", 0xff212121.toInt())
var customHeaderColor: Int by kpref("color_header", 0xff01579b.toInt())
@@ -49,6 +51,9 @@ object Prefs : KPref() {
val textColor: Int
get() = t.textColor
+ val accentColor: Int
+ get() = t.accentColor
+
val bgColor: Int
get() = t.bgColor
@@ -58,18 +63,6 @@ object Prefs : KPref() {
val iconColor: Int
get() = t.iconColor
- /**
- * Ensures that the color is visible against the background
- */
- val accentColor: Int
- get() = if (headerColor.isColorVisibleOn(bgColor, 100)) headerColor else textColor
-
- /**
- * Ensures that the color is visible against the background
- */
- val iconBackgroundColor: Int
- get() = if (headerColor.isColorVisibleOn(bgColor)) headerColor else headerColor.colorToForeground(0.2f)
-
val themeInjector: InjectorContract
get() = t.injector