Skip to content

Commit 5c1a2b3

Browse files
Robert LiaoCommit Bot
Robert Liao
authored and
Commit Bot
committedFeb 6, 2019
Route Dark Mode Windows Colors through GetAuraColor()
Win32 system colors currently don't support Dark Mode. As a result, fallback on the Aura colors. Inverted color schemes can be ignored here as it's only true when Chrome is running on a high-contrast AND when the relative luminance of COLOR_WINDOWTEXT is greater than COLOR_WINDOW (e.g. white on black), which is basically like dark mode. BUG=928378 Change-Id: I71ae0c1dd13213278461c04f50ae8ae8e5599a87 Reviewed-on: https://chromium-review.googlesource.com/c/1455646 Commit-Queue: Robert Liao <[email protected]> Auto-Submit: Robert Liao <[email protected]> Reviewed-by: Peter Kasting <[email protected]> Cr-Commit-Position: refs/heads/master@{#629610}
1 parent 847f5c7 commit 5c1a2b3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
 

‎ui/native_theme/native_theme_win.cc

+8
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,14 @@ void NativeThemeWin::PaintDirect(SkCanvas* destination_canvas,
432432
}
433433

434434
SkColor NativeThemeWin::GetSystemColor(ColorId color_id) const {
435+
// Win32 system colors currently don't support Dark Mode. As a result,
436+
// fallback on the Aura colors. Inverted color schemes can be ignored here
437+
// as it's only true when Chrome is running on a high-contrast AND when the
438+
// relative luminance of COLOR_WINDOWTEXT is greater than COLOR_WINDOW (e.g.
439+
// white on black), which is basically like dark mode.
440+
if (SystemDarkModeEnabled())
441+
return GetAuraColor(color_id, this);
442+
435443
// TODO: Obtain the correct colors for these using GetSysColor.
436444
// Button:
437445
constexpr SkColor kButtonHoverColor = SkColorSetRGB(6, 45, 117);

0 commit comments

Comments
 (0)
Please sign in to comment.