You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Electron currently has an isInvertedColorScheme that can be used to detect a sub-set of Windows' High Contrast modes (added in PR 7518). This only returns true for HC themes that are light-on-dark. If a dark-on-light HC theme is selected - see image below - this returns false.
This works fine for Chromium's purposes - they don't support HC mode fully, they just want to know when an inverse-style scheme is used so they can suggest an appropriate inverted Chrome theme; hence the name - isInvertedColorScheme, not isHighContrastColorScheme.
If an Electron-based app does want to fully support all flavors of Windows High Contrast mode, this method is insufficient.
Ideal solution here perhaps is to add an additional helper and event specifically for Windows HC mode, similar to the Chromium-based ones, but without the color-based filtering. Suggest isHighContrastModeEnabled and high-contrast-mode-changed.
Image below shows an example white-on-black HC theme. Windows ships with 4 built-in schemes, three of which are light-on-dark. Users can also create custom themes by modifying any of those built-in schemes.
The text was updated successfully, but these errors were encountered:
Electron currently has an
isInvertedColorScheme
that can be used to detect a sub-set of Windows' High Contrast modes (added in PR 7518). This only returns true for HC themes that are light-on-dark. If a dark-on-light HC theme is selected - see image below - this returns false.This helper uses Chromium's helper of the same name. That does check for Windows High Contrast Mode (ie whether the SPI_GETHIGHCONTRAST flag is set), but it then filters out color schemes that have foreground lighter than background.
This works fine for Chromium's purposes - they don't support HC mode fully, they just want to know when an inverse-style scheme is used so they can suggest an appropriate inverted Chrome theme; hence the name - isInvertedColorScheme, not isHighContrastColorScheme.
If an Electron-based app does want to fully support all flavors of Windows High Contrast mode, this method is insufficient.
Ideal solution here perhaps is to add an additional helper and event specifically for Windows HC mode, similar to the Chromium-based ones, but without the color-based filtering. Suggest
isHighContrastModeEnabled
andhigh-contrast-mode-changed
.Image below shows an example white-on-black HC theme. Windows ships with 4 built-in schemes, three of which are light-on-dark. Users can also create custom themes by modifying any of those built-in schemes.
The text was updated successfully, but these errors were encountered: