aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <morris.jobke@gmail.com>2013-09-02 16:41:18 +0200
committerMorris Jobke <morris.jobke@gmail.com>2013-09-02 16:41:18 +0200
commite7a14ea32df04f32bb08b318b2156a093964e837 (patch)
tree6c6c747be514dc0c270b25b4c4319f4f0b9a0097
parent06870a6e390f68d741893b4454b8fe4063404ca8 (diff)
downloadnextcloud-server-e7a14ea32df04f32bb08b318b2156a093964e837.tar.gz
nextcloud-server-e7a14ea32df04f32bb08b318b2156a093964e837.zip
RGB -> HSL
-rw-r--r--core/js/placeholder.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/js/placeholder.js b/core/js/placeholder.js
index 16543541cb4..16ebbf99a77 100644
--- a/core/js/placeholder.js
+++ b/core/js/placeholder.js
@@ -41,16 +41,13 @@
(function ($) {
$.fn.placeholder = function(seed) {
var hash = md5(seed),
- maxRange = parseInt('ffffffffff', 16),
- red = parseInt(hash.substr(0,10), 16) / maxRange * 256,
- green = parseInt(hash.substr(10,10), 16) / maxRange * 256,
- blue = parseInt(hash.substr(20,10), 16) / maxRange * 256,
- rgb = [Math.floor(red), Math.floor(green), Math.floor(blue)],
+ maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16),
+ hue = parseInt(hash, 16) / maxRange * 256,
height = this.height();
- this.css('background-color', 'rgb(' + rgb.join(',') + ')');
+ this.css('background-color', 'hsl(' + hue + ', 50%, 50%)');
// CSS rules
- this.css('color', 'rgb(255, 255, 255)');
+ this.css('color', '#fff');
this.css('font-weight', 'bold');
this.css('text-align', 'center');