diff --git a/extensions/chromium/preferences_schema.json b/extensions/chromium/preferences_schema.json
index 4b8d68623..799b0eaed 100644
--- a/extensions/chromium/preferences_schema.json
+++ b/extensions/chromium/preferences_schema.json
@@ -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",
diff --git a/web/app.js b/web/app.js
index b4b95ca0b..5ebe75555 100644
--- a/web/app.js
+++ b/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,
diff --git a/web/app_options.js b/web/app_options.js
index f0408b725..79c75b5e0 100644
--- a/web/app_options.js
+++ b/web/app_options.js
@@ -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",