From e7a14ea32df04f32bb08b318b2156a093964e837 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 2 Sep 2013 16:41:18 +0200 Subject: [PATCH 1/3] RGB -> HSL --- core/js/placeholder.js | 11 ++++------- 1 file 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'); From 57a1219ca0fb83a508e1df00263eb59d6aae61bf Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Mon, 2 Sep 2013 18:20:18 +0200 Subject: [PATCH 2/3] placeholder.js: adjust saturation and lightness values --- core/js/placeholder.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 16ebbf99a77..167499940b5 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -34,7 +34,7 @@ * * Which will result in: * - *
T
+ *
T
* */ @@ -44,7 +44,7 @@ maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16), hue = parseInt(hash, 16) / maxRange * 256, height = this.height(); - this.css('background-color', 'hsl(' + hue + ', 50%, 50%)'); + this.css('background-color', 'hsl(' + hue + ', 90%, 65%)'); // CSS rules this.css('color', '#fff'); From 9eeb27c91a43edb41cd6c341bad4b06298ec0d08 Mon Sep 17 00:00:00 2001 From: Jan-Christoph Borchardt Date: Mon, 2 Sep 2013 18:29:16 +0200 Subject: [PATCH 3/3] placeholder.js: fix typo --- core/js/placeholder.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 167499940b5..d63730547d7 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -34,7 +34,7 @@ * * Which will result in: * - *
T
+ *
T
* */