diff options
author | Jaida Wu <mlgmxyysd@meowcat.org> | 2022-02-06 17:36:28 +0800 |
---|---|---|
committer | alk3pInjection <webmaster@raspii.tech> | 2022-02-06 17:40:50 +0800 |
commit | 205535f99d7c4fe6aea496e3b6d1f77ccfaf24e2 (patch) | |
tree | 3ba43777b348a4b16db6a5cac87832e7999d6277 | |
parent | 3a8080842a7c874ad696de90edd8f77c3465fead (diff) |
fixup! Launcher3: Fix icon palette crashes
* Call setAlphaComponent() from ColorUtils.
Fixes: 72c0a79 ("Launcher3: Fix icon palette crashes")
Change-Id: Ie3e7193473184c8351c309ccfc0eee58519d3475
-rw-r--r-- | src/com/android/launcher3/graphics/IconPalette.java | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/com/android/launcher3/graphics/IconPalette.java b/src/com/android/launcher3/graphics/IconPalette.java index b9f3990d80..808156ccae 100644 --- a/src/com/android/launcher3/graphics/IconPalette.java +++ b/src/com/android/launcher3/graphics/IconPalette.java @@ -149,12 +149,7 @@ public class IconPalette { } private static double calculateContrast(int fg, int bg) { - bg = setAlphaComponent(bg, 255); - return ColorUtils.calculateContrast(fg, bg); - } - - private static int setAlphaComponent(int color, int alpha) { - return (color & 0x00ffffff) | (alpha << 24); + return ColorUtils.calculateContrast(fg, ColorUtils.setAlphaComponent(bg, 255)); } public static int getMutedColor(int color, float whiteScrimAlpha) { |