mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +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:
parent
bf870bd2ac
commit
9d11b51a3e
6 changed files with 15 additions and 18 deletions
|
@ -1049,7 +1049,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||
}
|
||||
|
||||
setStrokeRGBColor(r, g, b) {
|
||||
this.current.strokeColor = Util.makeCssRgb(r, g, b);
|
||||
this.current.strokeColor = Util.makeHexColor(r, g, b);
|
||||
}
|
||||
|
||||
setFillAlpha(fillAlpha) {
|
||||
|
@ -1057,7 +1057,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||
}
|
||||
|
||||
setFillRGBColor(r, g, b) {
|
||||
this.current.fillColor = Util.makeCssRgb(r, g, b);
|
||||
this.current.fillColor = Util.makeHexColor(r, g, b);
|
||||
this.current.tspan = this.svgFactory.createElement("svg:tspan");
|
||||
this.current.xcoords = [];
|
||||
this.current.ycoords = [];
|
||||
|
@ -1143,7 +1143,7 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) {
|
|||
this.svg = bbox;
|
||||
this.transformMatrix = matrix;
|
||||
if (paintType === 2) {
|
||||
const cssColor = Util.makeCssRgb(...color);
|
||||
const cssColor = Util.makeHexColor(...color);
|
||||
this.current.fillColor = cssColor;
|
||||
this.current.strokeColor = cssColor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue