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
|
"default": -1
|
||||||
},
|
},
|
||||||
|
"forcePageColors": {
|
||||||
|
"description": "When enabled, the pdf rendering will use the high contrast mode colors",
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
"pageColorsBackground": {
|
"pageColorsBackground": {
|
||||||
"description": "The color is a string as defined in CSS. Its goal is to help improve readability in high contrast mode",
|
"description": "The color is a string as defined in CSS. Its goal is to help improve readability in high contrast mode",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
@ -516,10 +516,14 @@ const PDFViewerApplication = {
|
|||||||
const container = appConfig.mainContainer,
|
const container = appConfig.mainContainer,
|
||||||
viewer = appConfig.viewerContainer;
|
viewer = appConfig.viewerContainer;
|
||||||
const annotationEditorMode = AppOptions.get("annotationEditorMode");
|
const annotationEditorMode = AppOptions.get("annotationEditorMode");
|
||||||
const pageColors = {
|
const pageColors =
|
||||||
|
AppOptions.get("forcePageColors") ||
|
||||||
|
window.matchMedia("(forced-colors: active)").matches
|
||||||
|
? {
|
||||||
background: AppOptions.get("pageColorsBackground"),
|
background: AppOptions.get("pageColorsBackground"),
|
||||||
foreground: AppOptions.get("pageColorsForeground"),
|
foreground: AppOptions.get("pageColorsForeground"),
|
||||||
};
|
}
|
||||||
|
: null;
|
||||||
|
|
||||||
this.pdfViewer = new PDFViewer({
|
this.pdfViewer = new PDFViewer({
|
||||||
container,
|
container,
|
||||||
|
@ -138,6 +138,11 @@ const defaultOptions = {
|
|||||||
value: 16777216,
|
value: 16777216,
|
||||||
kind: OptionKind.VIEWER,
|
kind: OptionKind.VIEWER,
|
||||||
},
|
},
|
||||||
|
forcePageColors: {
|
||||||
|
/** @type {boolean} */
|
||||||
|
value: false,
|
||||||
|
kind: OptionKind.VIEWER + OptionKind.PREFERENCE,
|
||||||
|
},
|
||||||
pageColorsBackground: {
|
pageColorsBackground: {
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
value: "Canvas",
|
value: "Canvas",
|
||||||
|
Loading…
Reference in New Issue
Block a user