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 |