summaryrefslogtreecommitdiffstats
path: root/core/js
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2016-04-18 09:22:28 +0200
committerskjnldsv <fremulon@protonmail.com>2016-04-18 09:29:42 +0200
commite11b39a248dd133f8ac08782935d0b522dd85fd8 (patch)
tree8e7259a1a168cfdd4bd43864223b8d135339679f /core/js
parentd5dbd4e0516b19ae77b555d286022714b5c44472 (diff)
downloadnextcloud-server-e11b39a248dd133f8ac08782935d0b522dd85fd8.tar.gz
nextcloud-server-e11b39a248dd133f8ac08782935d0b522dd85fd8.zip
Fix rgb values
Fix was required because values was too big for rgb and breaking the brightness calculation. Now we have the initial sat (70%) and the reduction to 60 if too bright working again.
Diffstat (limited to 'core/js')
-rw-r--r--core/js/placeholder.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/js/placeholder.js b/core/js/placeholder.js
index da721ac5bcb..1b03a28ecca 100644
--- a/core/js/placeholder.js
+++ b/core/js/placeholder.js
@@ -92,7 +92,7 @@
// Init vars
var result = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
var rgb = [0, 0, 0];
- var sat = 80;
+ var sat = 70;
var lum = 68;
var modulo = 16;
@@ -106,6 +106,12 @@
for(var count=1;count<modulo;count++) {
rgb[count%3] += parseInt(result[count]);
}
+
+ // Reduce values bigger than rgb requirements
+ rgb[0] = rgb[0]%255;
+ rgb[1] = rgb[1]%255;
+ rgb[2] = rgb[2]%255;
+
var hsl = rgbToHsl(rgb[0], rgb[1], rgb[2]);
// Classic formulla to check the brigtness for our eye