mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
Merge pull request #19408 from Snuffleupagus/rm-popup-color-mix-fallback
Remove the `color-mix` fallback used with PopupAnnotations
This commit is contained in:
commit
bdbd9a317f
1 changed files with 1 additions and 17 deletions
|
@ -2199,23 +2199,7 @@ class PopupElement {
|
|||
const baseColor = (popup.style.outlineColor = Util.makeHexColor(
|
||||
...this.#color
|
||||
));
|
||||
if (
|
||||
(typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) ||
|
||||
CSS.supports("background-color", "color-mix(in srgb, red 30%, white)")
|
||||
) {
|
||||
popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`;
|
||||
} else {
|
||||
// color-mix isn't supported in some browsers hence this version.
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix#browser_compatibility
|
||||
// TODO: Use color-mix when it's supported everywhere.
|
||||
// Enlighten the color.
|
||||
const BACKGROUND_ENLIGHT = 0.7;
|
||||
popup.style.backgroundColor = Util.makeHexColor(
|
||||
...this.#color.map(c =>
|
||||
Math.floor(BACKGROUND_ENLIGHT * (255 - c) + c)
|
||||
)
|
||||
);
|
||||
}
|
||||
popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`;
|
||||
}
|
||||
|
||||
const header = document.createElement("span");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue