1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Replace css color rgb(...) by #...

* it's faster to generate the color code in using a table for components
* it's very likely a way faster to parse (when setting the color in the canvas)
This commit is contained in:
Calixte Denizet 2020-10-30 14:51:50 +01:00
parent bf870bd2ac
commit 9d11b51a3e
6 changed files with 15 additions and 18 deletions

View file

@ -205,14 +205,14 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
ratio[0] = t0 + i * step;
fn(ratio, 0, color, 0);
rgbColor = cs.getRgb(color, 0);
var cssColor = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
var cssColor = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]);
colorStops.push([i / NUMBER_OF_SAMPLES, cssColor]);
}
var background = "transparent";
if (dict.has("Background")) {
rgbColor = cs.getRgb(dict.get("Background"), 0);
background = Util.makeCssRgb(rgbColor[0], rgbColor[1], rgbColor[2]);
background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]);
}
if (!extendStart) {