Commit 96ce623c authored by Piotr Gawron's avatar Piotr Gawron
Browse files

fix on overlays coloring (center is in white)

parent 8d8ff1f7
minerva (10.0.4) stable; urgency=medium
* Bug fix: overlays colors are centered in white (not black)
-- Piotr Gawron <piotr.gawron@uni.lu> Fri, 16 Dec 2016 10:01:16 +0200
minerva (10.0.3) stable; urgency=medium
* Bug fix: login cannot contain whitespace
......
-- empty file to force directory to be commited to git repo
......@@ -167,20 +167,26 @@ overlayToColor = function(elementOverlay) {
ratio = elementOverlay.value;
color = ServerConnector.getMaxOverlayColorInt();
}
var red = color & 0xFF0000;
red = red*ratio;
ratio = 1 - ratio
var MAX_RED = 0xFF0000;
var MAX_GREEN = 0x00FF00;
var MAX_BLUE = 0x0000FF;
var red = color & MAX_RED;
red = red+ (MAX_RED-red)* ratio;
red = parseInt(red);
red = red & 0xFF0000;
var green = color & 0x00FF00;
green = green*ratio;
var green = color & MAX_GREEN;
green = green + (MAX_GREEN-green)* ratio;
green = parseInt(green);
green = green & 0x00FF00;
green = green & MAX_GREEN;
var blue = color & 0x0000FF;
blue = blue*ratio;
var blue = color & MAX_BLUE;
blue = blue + (MAX_BLUE-blue)* ratio;
blue = parseInt(blue);
blue = blue & 0x0000FF;
blue = blue & MAX_BLUE;
var color = red | green | blue;
return intToColorString(color);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment