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

Unified Diff: ui/gfx/color_utils.cc

Issue 1408273002: Make some updates to BM bar for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eschew redundancy Created 5 years, 2 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/color_utils.cc
diff --git a/ui/gfx/color_utils.cc b/ui/gfx/color_utils.cc
index 65d0fa252d43a85fa9dfcf46a98b3b86beb7393f..c2f1b3f974d67b22d3d73df32a3b7bcb572e5450 100644
--- a/ui/gfx/color_utils.cc
+++ b/ui/gfx/color_utils.cc
@@ -78,6 +78,10 @@ double ContrastRatio(double foreground_luminance, double background_luminance) {
// ----------------------------------------------------------------------------
+double GetContrastRatio(SkColor color_a, SkColor color_b) {
+ return ContrastRatio(RelativeLuminance(color_a), RelativeLuminance(color_b));
+}
+
unsigned char GetLuminanceForColor(SkColor color) {
return base::saturated_cast<unsigned char>(
(0.3 * SkColorGetR(color)) +
« no previous file with comments | « ui/gfx/color_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698