aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/utils/UIHelper.java
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-11-16 17:21:21 +0100
committeriNPUTmice <daniel@gultsch.de>2014-11-16 17:21:21 +0100
commitcf00f3fade1e76ff9360e96d5505d49c7c89d5c4 (patch)
tree0617dcc0eff219a19e555aba6096e24d9ef2e30c /src/main/java/eu/siacs/conversations/utils/UIHelper.java
parent84b2ce10b7a38aaaa9d2d3ee8ad4e1213402640f (diff)
happy hanukkah
Diffstat (limited to 'src/main/java/eu/siacs/conversations/utils/UIHelper.java')
-rw-r--r--src/main/java/eu/siacs/conversations/utils/UIHelper.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/utils/UIHelper.java b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
index c4832d60c..0d43450d1 100644
--- a/src/main/java/eu/siacs/conversations/utils/UIHelper.java
+++ b/src/main/java/eu/siacs/conversations/utils/UIHelper.java
@@ -188,4 +188,11 @@ public class UIHelper {
}
return body;
}
+
+ public static int getColorForName(String name) {
+ int colors[] = {0xFFe91e63, 0xFF9c27b0, 0xFF673ab7, 0xFF3f51b5,
+ 0xFF5677fc, 0xFF03a9f4, 0xFF00bcd4, 0xFF009688, 0xFFff5722,
+ 0xFF795548, 0xFF607d8b};
+ return colors[(int) ((name.hashCode() & 0xffffffffl) % colors.length)];
+ }
}