mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Use default colors only in forced-colors mode (bug 1778068)
This commit is contained in:
parent
32d8c55642
commit
fe93742c8f
3 changed files with 18 additions and 4 deletions
12
web/app.js
12
web/app.js
|
@ -516,10 +516,14 @@ const PDFViewerApplication = {
|
|||
const container = appConfig.mainContainer,
|
||||
viewer = appConfig.viewerContainer;
|
||||
const annotationEditorMode = AppOptions.get("annotationEditorMode");
|
||||
const pageColors = {
|
||||
background: AppOptions.get("pageColorsBackground"),
|
||||
foreground: AppOptions.get("pageColorsForeground"),
|
||||
};
|
||||
const pageColors =
|
||||
AppOptions.get("forcePageColors") ||
|
||||
window.matchMedia("(forced-colors: active)").matches
|
||||
? {
|
||||
background: AppOptions.get("pageColorsBackground"),
|
||||
foreground: AppOptions.get("pageColorsForeground"),
|
||||
}
|
||||
: null;
|
||||
|
||||
this.pdfViewer = new PDFViewer({
|
||||
container,
|
||||
|
|
|
@ -138,6 +138,11 @@ const defaultOptions = {
|
|||
value: 16777216,
|
||||
kind: OptionKind.VIEWER,
|
||||
},
|
||||
forcePageColors: {
|
||||
/** @type {boolean} */
|
||||
value: false,
|
||||
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
||||
},
|
||||
pageColorsBackground: {
|
||||
/** @type {string} */
|
||||
value: "Canvas",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue