]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/utils/Colors.java
rework colours using more colour theory
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / utils / Colors.java
index 283f9ea7796bfb4eaa6c3c4cb7f683e94ff26bc2..d13496fe813b8a3b158acffd7442ad6434c85a23 100644 (file)
@@ -48,7 +48,7 @@ public class Colors {
     private static final float yellowLightness = 0.350f;
     private static final int[][] EMPTY_STATES = new int[][]{new int[0]};
     public static @ColorInt
-    int accent;
+    int secondary;
     @ColorInt
     public static int tableRowDarkBG;
     public static int profileThemeId = -1;
@@ -78,8 +78,8 @@ public class Colors {
         TypedValue tv = new TypedValue();
         theme.resolveAttribute(R.attr.table_row_dark_bg, tv, true);
         tableRowDarkBG = tv.data;
-        theme.resolveAttribute(R.attr.colorAccent, tv, true);
-        accent = tv.data;
+        theme.resolveAttribute(R.attr.colorSecondary, tv, true);
+        secondary = tv.data;
 
         // trigger theme observers
         themeWatch.postValue(themeWatch.getValue() + 1);
@@ -125,17 +125,17 @@ public class Colors {
     public static float baseHueLightness(int baseHueDegrees) {
         switch (baseHueDegrees % 360) {
             case 0:
-                return 0.450f;   // red
+                return 0.550f;   // red
             case 60:
-                return 0.400f;  // yellow
+                return 0.250f;  // yellow
             case 120:
-                return 0.400f;  // green
+                return 0.290f;  // green
             case 180:
-                return 0.400f;  // cyan
+                return 0.300f;  // cyan
             case 240:
-                return 0.750f;  // blue
+                return 0.710f;  // blue
             case 300:
-                return 0.500f;   // magenta
+                return 0.450f;   // magenta
             default:
                 throw new IllegalStateException(
                         String.format(Locale.US, "baseHueLightness called with invalid value %d",