diff options
author | Selim Cinek <cinek@google.com> | 2017-06-24 00:44:08 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-06-24 00:44:13 +0000 |
commit | 9bf5c0c3e17595efafb14c850ae097756d0d2ae4 (patch) | |
tree | 33c53b05583535ce8bf3a67db4db18026a2486bb | |
parent | 4b6219dab386195a7be087245a0a3650fdff381e (diff) | |
parent | 4c80791919cd0da976ae5329dd7da9a0c4b3087c (diff) | |
download | base-9bf5c0c3e17595efafb14c850ae097756d0d2ae4.tar.gz |
Merge "Fixed an issue in the contrast calculation" into oc-dev
-rw-r--r-- | core/java/com/android/internal/util/NotificationColorUtil.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/java/com/android/internal/util/NotificationColorUtil.java b/core/java/com/android/internal/util/NotificationColorUtil.java index 1ba92bfb6a77..0c046a92020b 100644 --- a/core/java/com/android/internal/util/NotificationColorUtil.java +++ b/core/java/com/android/internal/util/NotificationColorUtil.java @@ -534,7 +534,7 @@ public class NotificationColorUtil { } public static boolean satisfiesTextContrast(int backgroundColor, int foregroundColor) { - return NotificationColorUtil.calculateContrast(backgroundColor, foregroundColor) >= 4.5; + return NotificationColorUtil.calculateContrast(foregroundColor, backgroundColor) >= 4.5; } /** @@ -613,7 +613,7 @@ public class NotificationColorUtil { */ public static double calculateContrast(@ColorInt int foreground, @ColorInt int background) { if (Color.alpha(background) != 255) { - throw new IllegalArgumentException("background can not be translucent: #" + Log.wtf(TAG, "background can not be translucent: #" + Integer.toHexString(background)); } if (Color.alpha(foreground) < 255) { |