We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d60e6f3 commit 73577a8Copy full SHA for 73577a8
scripts/JSRootPainter.js
@@ -248,7 +248,12 @@
248
249
JSROOT.Painter.MakeColorRGB = function(col) {
250
if ((col==null) || (col._typename != 'TColor')) return null;
251
- var rgb = "rgb(" + (col.fRed*255).toFixed(0) + "," + (col.fGreen*255).toFixed(0) + "," + (col.fBlue*255).toFixed(0) + ")";
+ var rgb = Math.round(col.fRed*255) + "," + Math.round(col.fGreen*255) + "," + Math.round(col.fBlue*255);
252
+ if ((col.fAlpha === undefined) || (col.fAlpha == 1.))
253
+ rgb = "rgb(" + rgb + ")";
254
+ else
255
+ rgb = "rgba(" + rgb + "," + col.fAlpha.toFixed(3) + ")";
256
+
257
switch (rgb) {
258
case 'rgb(255,255,255)' : rgb = 'white'; break;
259
case 'rgb(0,0,0)' : rgb = 'black'; break;
0 commit comments