]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/utils/Colors.java
whitespace
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / utils / Colors.java
index 80ec58ab82db1f642d10b1a76716a9362e1dc2e0..be68ccc70f261e16821cd3ef4c7e7fa92fa1550b 100644 (file)
@@ -58,6 +58,7 @@ public class Colors {
     public static int profileThemeId = -1;
     public static MutableLiveData<Integer> themeWatch = new MutableLiveData<>(0);
     public static int errorTextColor;
+    private static int SWIPE_COLOR_COUNT = 6;
     private static int[] themeIDs =
             {R.style.AppTheme_000, R.style.AppTheme_005,
              R.style.AppTheme_010, R.style.AppTheme_015,
@@ -230,7 +231,6 @@ public class Colors {
 
         refreshColors(activity.getTheme());
     }
-
     public static @NonNull
     ColorStateList getColorStateList() {
         return getColorStateList(profileThemeId);
@@ -243,8 +243,8 @@ public class Colors {
         return getSwipeCircleColors(profileThemeId);
     }
     public static int[] getSwipeCircleColors(int hue) {
-        int[] colors = new int[]{0, 0, 0, 0, 0, 0};
-        for (int i = 0; i < 6; i++, hue = (hue + 60) % 360) {
+        int[] colors = new int[SWIPE_COLOR_COUNT];
+        for (int i = 0; i < SWIPE_COLOR_COUNT; i++, hue = (hue + 360 / SWIPE_COLOR_COUNT) % 360) {
             colors[i] = getPrimaryColorForHue(hue);
         }
         return colors;
@@ -275,7 +275,7 @@ public class Colors {
                 for (int h : hues) {
                     if (huesSB.length() > 0)
                         huesSB.append(", ");
-                    huesSB.append(String.valueOf(h));
+                    huesSB.append(h);
                 }
                 debug("profiles", String.format("used hues: %s", huesSB.toString()));
             }