Debian Codegraph @

plugins/ubuntu-plugin/imports/components/private/UiUtils.js

raw symbols SCIP
1 /* Copyright (C) 2016 Dan Chapman <[email protected]>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 .pragma library
19 // original avatar colors
20 //var avatarColors = ["#6b9362", "#4d8fac", "#bb7796", "#b95754", "#ffa565", "#f7bb7d", "#bda928"]
21 // Possibly good for dark theme
22 //var avatarColors = ["#bc97ff", "#e8abb7", "#7dabff", "#88cfbc", "#b1f9a5"]
23 // Nice new ones :-D no more pukey greeny/brown
24 var avatarColors = ["#797DC3","#88a825", "#3A8891", "#cf4a30", "#ed8c2b", "#5E82BD"]
25
26 function getIconColor(name) {
27 var tmp = 0;
28 for (var i = 0; i < name.length; i++) {
29 tmp += name.charCodeAt(i);
30 }
31 return avatarColors[tmp % avatarColors.length];
32 }
33