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
- Open Command Palette → Preferences: Open Settings (JSON)
- Search for
vscode_custom_css.imports - Comment out or remove any external stylesheets referencing
invert - Reload VS Code
Reset Workbench Color Customizations
- In Settings, search for Workbench: Color Customizations
- Click Edit in settings.json
- Remove overrides targeting
editor.backgroundoreditor.foreground - Save and reload
Step 2: Inspect PDF Extensions
- Go to Extensions and disable PDF rendering add-ons temporarily
- Reload the window (
Ctrl/Cmd + R) - View the PDF with the built-in preview
- 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
- Windows: Press Windows + Ctrl + C to turn off Color Filters
- macOS: Press Option + Command + 8 (Classic Invert) or disable Smart Invert in Accessibility settings
- Linux: Check GNOME/KDE accessibility modules for inverted color profiles
If the system itself is inverted, VS Code simply reflects that state.
Step 4: GPU Acceleration and HDR
- Navigate to Settings → Features → Editor → Enable GPU Acceleration and toggle it off
- On Windows, disable HDR under Settings → System → Display
- Update GPU drivers—outdated drivers often mis-handle PDF shaders
Step 5: Destroy the Cached Preview
- Close VS Code
- Delete the
UserData/Cachefolder (location depends on OS) - Relaunch and reopen the PDF
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
- [ ] Remove custom CSS injections
- [ ] Reset workbench color overrides
- [ ] Disable PDF extensions that add high contrast
- [ ] Toggle OS inversion shortcuts
- [ ] Update GPU drivers and clear caches
- [ ] Use the dedicated PDF inverter when you need controlled dark-mode exports
By following these steps, you can resolve PDFs in VS Code inverted colors issues and keep a reliable fallback for dark-mode reading.