Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(382)

Unified Diff: ui/gfx/sys_color_change_listener.cc

Issue 1761183002: color_utils cleanup: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename functions Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/color_utils.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/sys_color_change_listener.cc
diff --git a/ui/gfx/sys_color_change_listener.cc b/ui/gfx/sys_color_change_listener.cc
index a81409618e0dc780dda7e73dd17b0316567f4703..fcda18935af852afdd4a7b7d75353f5996984919 100644
--- a/ui/gfx/sys_color_change_listener.cc
+++ b/ui/gfx/sys_color_change_listener.cc
@@ -20,16 +20,16 @@ bool g_is_inverted_color_scheme = false;
bool g_is_inverted_color_scheme_initialized = false;
void UpdateInvertedColorScheme() {
- int foreground_luminance = color_utils::GetLuminanceForColor(
- color_utils::GetSysSkColor(COLOR_WINDOWTEXT));
- int background_luminance = color_utils::GetLuminanceForColor(
- color_utils::GetSysSkColor(COLOR_WINDOW));
+ const uint8_t foreground_luma =
+ color_utils::GetLuma(color_utils::GetSysSkColor(COLOR_WINDOWTEXT));
+ const uint8_t background_luma =
+ color_utils::GetLuma(color_utils::GetSysSkColor(COLOR_WINDOW));
HIGHCONTRAST high_contrast = {0};
high_contrast.cbSize = sizeof(HIGHCONTRAST);
g_is_inverted_color_scheme =
SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &high_contrast, 0) &&
((high_contrast.dwFlags & HCF_HIGHCONTRASTON) != 0) &&
- foreground_luminance > background_luminance;
+ foreground_luma > background_luma;
g_is_inverted_color_scheme_initialized = true;
}
« no previous file with comments | « ui/gfx/color_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698