mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +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
|
@ -221,7 +221,7 @@ class AnnotationElement {
|
|||
}
|
||||
|
||||
if (data.color) {
|
||||
container.style.borderColor = Util.makeCssRgb(
|
||||
container.style.borderColor = Util.makeHexColor(
|
||||
data.color[0] | 0,
|
||||
data.color[1] | 0,
|
||||
data.color[2] | 0
|
||||
|
@ -860,7 +860,7 @@ class PopupElement {
|
|||
const r = BACKGROUND_ENLIGHT * (255 - color[0]) + color[0];
|
||||
const g = BACKGROUND_ENLIGHT * (255 - color[1]) + color[1];
|
||||
const b = BACKGROUND_ENLIGHT * (255 - color[2]) + color[2];
|
||||
popup.style.backgroundColor = Util.makeCssRgb(r | 0, g | 0, b | 0);
|
||||
popup.style.backgroundColor = Util.makeHexColor(r | 0, g | 0, b | 0);
|
||||
}
|
||||
|
||||
const title = document.createElement("h1");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue