Skip to content
Snippets Groups Projects
Commit fd96331e authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Merge pull request #21323 from owncloud/placeholder_sane_precission

[Avatars] Calculate 'sane' hue precissions
parents 9cdc3f05 2fc45847
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,8 @@ ...@@ -51,8 +51,8 @@
// set optional argument "text" to value of "seed" if undefined // set optional argument "text" to value of "seed" if undefined
text = text || seed; text = text || seed;
var hash = md5(seed), var hash = md5(seed).substring(0, 4),
maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16), maxRange = parseInt('ffff', 16),
hue = parseInt(hash, 16) / maxRange * 256, hue = parseInt(hash, 16) / maxRange * 256,
height = this.height() || size || 32; height = this.height() || size || 32;
this.css('background-color', 'hsl(' + hue + ', 90%, 65%)'); this.css('background-color', 'hsl(' + hue + ', 90%, 65%)');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment