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

@ -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");