mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
More Colors for habits
This commit is contained in:
@@ -181,8 +181,8 @@ public class HabitListTest extends BaseAndroidTest
|
||||
|
||||
String expectedCSV =
|
||||
"Position,Name,Description,NumRepetitions,Interval,Color\n" +
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#AFB42B\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#00897B\n";
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#F9A825\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#388E3C\n";
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
habitList.writeCSV(writer);
|
||||
|
||||
@@ -27,18 +27,21 @@ public abstract class ColorUtils
|
||||
{
|
||||
public static String CSV_PALETTE[] = {
|
||||
"#D32F2F", // 0 red
|
||||
"#E64A19", // 1 orange
|
||||
"#F9A825", // 2 yellow
|
||||
"#AFB42B", // 3 light green
|
||||
"#388E3C", // 4 dark green
|
||||
"#00897B", // 5 teal
|
||||
"#00ACC1", // 6 cyan
|
||||
"#039BE5", // 7 blue
|
||||
"#5E35B1", // 8 deep purple
|
||||
"#8E24AA", // 9 purple
|
||||
"#D81B60", // 10 pink
|
||||
"#303030", // 11 dark grey
|
||||
"#aaaaaa" // 12 light grey
|
||||
"#E64A19", // 1 deep orange
|
||||
"#F57C00", // 2 orange
|
||||
"#F9A825", // 3 yellow
|
||||
"#AFB42B", // 4 light green
|
||||
"#388E3C", // 5 dark green
|
||||
"#00897B", // 6 teal
|
||||
"#00ACC1", // 7 cyan
|
||||
"#039BE5", // 8 blue
|
||||
"#5E35B1", // 9 deep purple
|
||||
"#8E24AA", // 10 purple
|
||||
"#D81B60", // 11 pink
|
||||
"#5D4037", // 12 brown
|
||||
"#303030", // 13 dark grey
|
||||
"#757575", // 14 grey
|
||||
"#aaaaaa" // 15 light grey
|
||||
};
|
||||
|
||||
public static int colorToPaletteIndex(Context context, int color)
|
||||
@@ -56,18 +59,21 @@ public abstract class ColorUtils
|
||||
{
|
||||
int palette[] = {
|
||||
Color.parseColor("#D32F2F"), // 0 red
|
||||
Color.parseColor("#E64A19"), // 1 orange
|
||||
Color.parseColor("#F9A825"), // 2 yellow
|
||||
Color.parseColor("#AFB42B"), // 3 light green
|
||||
Color.parseColor("#388E3C"), // 4 dark green
|
||||
Color.parseColor("#00897B"), // 5 teal
|
||||
Color.parseColor("#00ACC1"), // 6 cyan
|
||||
Color.parseColor("#039BE5"), // 7 blue
|
||||
Color.parseColor("#5E35B1"), // 8 deep purple
|
||||
Color.parseColor("#8E24AA"), // 9 purple
|
||||
Color.parseColor("#D81B60"), // 10 pink
|
||||
Color.parseColor("#303030"), // 11 dark grey
|
||||
Color.parseColor("#aaaaaa") // 12 light grey
|
||||
Color.parseColor("#E64A19"), // 1 deep orange
|
||||
Color.parseColor("#F57C00"), // 2 orange
|
||||
Color.parseColor("#F9A825"), // 3 yellow
|
||||
Color.parseColor("#AFB42B"), // 4 light green
|
||||
Color.parseColor("#388E3C"), // 5 dark green
|
||||
Color.parseColor("#00897B"), // 6 teal
|
||||
Color.parseColor("#00ACC1"), // 7 cyan
|
||||
Color.parseColor("#039BE5"), // 8 blue
|
||||
Color.parseColor("#5E35B1"), // 9 deep purple
|
||||
Color.parseColor("#8E24AA"), // 10 purple
|
||||
Color.parseColor("#D81B60"), // 11 pink
|
||||
Color.parseColor("#5D4037"), // 12 brown
|
||||
Color.parseColor("#303030"), // 13 dark grey
|
||||
Color.parseColor("#757575"), // 14 grey
|
||||
Color.parseColor("#aaaaaa") // 15 light grey
|
||||
};
|
||||
|
||||
return palette[index];
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<array name="lightPalette">
|
||||
<item>@color/red_700</item>
|
||||
<item>@color/deep_orange_700</item>
|
||||
<item>@color/orange_700</item>
|
||||
<item>@color/yellow_800</item>
|
||||
<item>@color/lime_700</item>
|
||||
<item>@color/green_700</item>
|
||||
@@ -28,13 +29,16 @@
|
||||
<item>@color/deep_purple_600</item>
|
||||
<item>@color/purple_600</item>
|
||||
<item>@color/pink_600</item>
|
||||
<item>@color/brown_700</item>
|
||||
<item>@color/grey_800</item>
|
||||
<item>@color/grey_600</item>
|
||||
<item>@color/grey_500</item>
|
||||
</array>
|
||||
|
||||
<array name="darkPalette">
|
||||
<item>@color/red_200</item>
|
||||
<item>@color/deep_orange_200</item>
|
||||
<item>@color/orange_200</item>
|
||||
<item>@color/yellow_200</item>
|
||||
<item>@color/lime_200</item>
|
||||
<item>@color/green_A200</item>
|
||||
@@ -44,13 +48,16 @@
|
||||
<item>@color/deep_purple_200</item>
|
||||
<item>@color/purple_200</item>
|
||||
<item>@color/pink_200</item>
|
||||
<item>@color/brown_200</item>
|
||||
<item>@color/grey_100</item>
|
||||
<item>@color/grey_300</item>
|
||||
<item>@color/grey_500</item>
|
||||
</array>
|
||||
|
||||
<array name="transparentWidgetPalette">
|
||||
<item>@color/red_800</item>
|
||||
<item>@color/deep_orange_800</item>
|
||||
<item>@color/orange_800</item>
|
||||
<item>@color/yellow_800</item>
|
||||
<item>@color/lime_800</item>
|
||||
<item>@color/green_700</item>
|
||||
@@ -60,6 +67,8 @@
|
||||
<item>@color/deep_purple_700</item>
|
||||
<item>@color/purple_700</item>
|
||||
<item>@color/pink_700</item>
|
||||
<item>@color/brown_800</item>
|
||||
<item>@color/black_aa</item>
|
||||
<item>@color/black_aa</item>
|
||||
<item>@color/black_aa</item>
|
||||
</array>
|
||||
|
||||
@@ -172,8 +172,8 @@ public class HabitListTest extends BaseUnitTest
|
||||
|
||||
String expectedCSV =
|
||||
"Position,Name,Description,NumRepetitions,Interval,Color\n" +
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#AFB42B\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#00897B\n";
|
||||
"001,Meditate,Did you meditate this morning?,1,1,#F9A825\n" +
|
||||
"002,Wake up early,Did you wake up before 6am?,2,3,#388E3C\n";
|
||||
|
||||
StringWriter writer = new StringWriter();
|
||||
list.writeCSV(writer);
|
||||
|
||||
Reference in New Issue
Block a user