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

Unified Diff: ui/gfx/color_utils.h

Issue 1408273002: Make some updates to BM bar for MD. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also update detached bg 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
Index: ui/gfx/color_utils.h
diff --git a/ui/gfx/color_utils.h b/ui/gfx/color_utils.h
index f49054520f4163f5de055bcccd4fdda866bd8e0a..07f5f0a275265c7d752007c3a40004a3da311c64 100644
--- a/ui/gfx/color_utils.h
+++ b/ui/gfx/color_utils.h
@@ -20,6 +20,13 @@ struct HSL {
double l;
};
+// The minimum contrast between text and background that is still readable.
+// This value is taken from w3c accessibility guidelines.
+const double kMinimumReadableContrastRatio = 4.5f;
+
+// Determines the contrast ratio of two colors.
+GFX_EXPORT double GetContrastRatio(SkColor color_a, SkColor color_b);
+
GFX_EXPORT unsigned char GetLuminanceForColor(SkColor color);
// Calculated according to http://www.w3.org/TR/WCAG20/#relativeluminancedef

Powered by Google App Engine
This is Rietveld 408576698