InvertColors
Last updated: June 20, 2025

PDFs in VS Code Suddenly Inverted Colors? Here’s How to Fix It

If you preview a PDF inside Visual Studio Code and discover that every page looks like a horror-movie negative, you’re not alone. The issue typically stems from accessibility extensions, custom CSS, or color inversion settings at the OS level. This playbook shows how to fix VS Code PDF inverted colors in minutes—and how to keep a clean fallback by routing documents through /invert-pdf-colors.

Step 1: Check VS Code Settings

Disable Custom CSS & JS Loader

  1. Open Command Palette → Preferences: Open Settings (JSON)
  2. Search for vscode_custom_css.imports
  3. Comment out or remove any external stylesheets referencing invert
  4. Reload VS Code

Reset Workbench Color Customizations

  1. In Settings, search for Workbench: Color Customizations
  2. Click Edit in settings.json
  3. Remove overrides targeting editor.background or editor.foreground
  4. Save and reload

Step 2: Inspect PDF Extensions

  1. Go to Extensions and disable PDF rendering add-ons temporarily
  2. Reload the window (Ctrl/Cmd + R)
  3. View the PDF with the built-in preview
  4. Re-enable extensions one-by-one to isolate the culprit

Common offenders include extensions that inject contrast filters meant for code themes but that also hook into PDF previews.

Step 3: OS Accessibility Toggles

If the system itself is inverted, VS Code simply reflects that state.

Step 4: GPU Acceleration and HDR

  1. Navigate to Settings → Features → Editor → Enable GPU Acceleration and toggle it off
  2. On Windows, disable HDR under Settings → System → Display
  3. Update GPU drivers—outdated drivers often mis-handle PDF shaders

Step 5: Destroy the Cached Preview

A stale cache can hang onto inverted frames even after you fix settings.

When Fixes Don’t Stick

Occasionally, corporate policies or workspace settings reapply inversion scripts. When that happens, export the PDF to a safe location and open it via /invert-pdf-colors. The browser-based workflow keeps everything private, lets you choose between full invert and dark-mode style, and produces clean downloads with zero watermark.

Quick Checklist

By following these steps, you can resolve PDFs in VS Code inverted colors issues and keep a reliable fallback for dark-mode reading.