Merge pull request #15135 from calixteman/forced_colors
Use default colors only in forced-colors mode (bug 1778068)
This commit is contained in:
commit
b0a3c9e8cf
@ -213,6 +213,11 @@
|
||||
],
|
||||
"default": -1
|
||||
},
|
||||
"forcePageColors": {
|
||||
"description": "When enabled, the pdf rendering will use the high contrast mode colors",
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
},
|
||||
"pageColorsBackground": {
|
||||
"description": "The color is a string as defined in CSS. Its goal is to help improve readability in high contrast mode",
|
||||
"type": "string",
|
||||
|
@ -516,10 +516,14 @@ const PDFViewerApplication = {
|
||||
const container = appConfig.mainContainer,
|
||||
viewer = appConfig.viewerContainer;
|
||||
const annotationEditorMode = AppOptions.get("annotationEditorMode");
|
||||
const pageColors = {
|
||||
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…
Reference in New Issue
Block a user