summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Selim Cinek <cinek@google.com> 2017-06-24 00:55:46 +0000
committer android-build-merger <android-build-merger@google.com> 2017-06-24 00:55:46 +0000
commitff122e750c90c5c076107a636f9529a5796677b6 (patch)
tree9cabee1916c000b1b23929e20ba5e861a4949434
parent0dd8a3cd597ec3d0b208513a87ae1a4404354a45 (diff)
parent9bf5c0c3e17595efafb14c850ae097756d0d2ae4 (diff)
Merge "Fixed an issue in the contrast calculation" into oc-dev
am: 9bf5c0c3e1 Change-Id: I9f1dc8c2c6d2ad461efc2722a5b1829f753dfcd4
-rw-r--r--core/java/com/android/internal/util/NotificationColorUtil.java4
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) {