diff options
author | Morris Jobke <morris.jobke@gmail.com> | 2013-09-03 02:18:39 -0700 |
---|---|---|
committer | Morris Jobke <morris.jobke@gmail.com> | 2013-09-03 02:18:39 -0700 |
commit | 2da6f6b4ce6d0eb547a0e43230fce456f9973635 (patch) | |
tree | dbdf8df97b8834d12e84e1662d0d96a44c633d92 | |
parent | a7de0e965298822f071c3137ca925d1920c03a27 (diff) | |
parent | 9eeb27c91a43edb41cd6c341bad4b06298ec0d08 (diff) | |
download | nextcloud-server-2da6f6b4ce6d0eb547a0e43230fce456f9973635.tar.gz nextcloud-server-2da6f6b4ce6d0eb547a0e43230fce456f9973635.zip |
Merge pull request #4695 from owncloud/placeholder-hsl
RGB -> HSL
-rw-r--r-- | core/js/placeholder.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 16543541cb4..d63730547d7 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -34,23 +34,20 @@ * * Which will result in: * - * <div id="albumart" style="background-color: rgb(123, 123, 123); ... ">T</div> + * <div id="albumart" style="background-color: hsl(123, 90%, 65%); ... ">T</div> * */ (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 + ', 90%, 65%)'); // CSS rules - this.css('color', 'rgb(255, 255, 255)'); + this.css('color', '#fff'); this.css('font-weight', 'bold'); this.css('text-align', 'center'); |