diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2016-04-20 15:51:06 +0300 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2016-04-20 15:51:06 +0300 |
commit | f270d0f870e43319ae7707d700a942d976e415dd (patch) | |
tree | 4498becdfa3ec1f98053d7ff1931943219a5d12b | |
parent | 2db17a3f8ad72eecde69774d031bb46e3c10e24b (diff) | |
parent | d3f351f591899b8ec221d94fec9c6b5dfb64b3eb (diff) |
Merge pull request #1434 from owncloud/space-account-colors-evenly
Force visually distinguishable account colors
-rwxr-xr-x | js/views/helper.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/views/helper.js b/js/views/helper.js index 94dda9dd2..ba5a0a365 100755 --- a/js/views/helper.js +++ b/js/views/helper.js @@ -36,7 +36,8 @@ define(function(require) { var hash = md5(account); if (typeof hash.toHsl === 'function') { var hsl = hash.toHsl(); - return new Handlebars.SafeString('hsl(' + hsl[0] + ', ' + hsl[1] + '%, ' + hsl[2] + '%)'); + var hue = Math.round(hsl[0]/40)*40; + return new Handlebars.SafeString('hsl(' + hue + ', ' + hsl[1] + '%, ' + hsl[2] + '%)'); } else { var maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16); var hue = parseInt(hash, 16) / maxRange * 256; |