Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f5583930 authored by Selim Cinek's avatar Selim Cinek Committed by android-build-merger
Browse files

Merge "Fixed an issue in the contrast calculation" into oc-dev am: 9bf5c0c3 am: 12a2a7d0

am: ec85913a

Change-Id: I41d8577da4a6ca93252027bd85ee632decaae56f
parents 8568192e ec85913a
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -557,7 +557,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;
    }

    /**
@@ -636,7 +636,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) {