From 0789a7d67f3f610108232fc13a0642e94bb03258 Mon Sep 17 00:00:00 2001 From: James O'Leary Date: Wed, 22 Sep 2021 10:30:15 -0400 Subject: [PATCH] [CP] Use chroma max of 40 at tone 90 Bug: 199389758 Test: atest ColorSchemeTest Change-Id: I295ef3a6ad4d64c26ef150c853ec9875cf2ad8ff --- .../monet/src/com/android/systemui/monet/Shades.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java b/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java index 498b7dd8658cf..aab3538e3c4c1 100644 --- a/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java +++ b/packages/SystemUI/monet/src/com/android/systemui/monet/Shades.java @@ -53,10 +53,15 @@ public class Shades { */ public static @ColorInt int[] of(float hue, float chroma) { int[] shades = new int[12]; - shades[0] = ColorUtils.CAMToColor(hue, chroma, 99); - shades[1] = ColorUtils.CAMToColor(hue, chroma, 95); + // At tone 90 and above, blue and yellow hues can reach a much higher chroma. + // To preserve a consistent appearance across all hues, use a maximum chroma of 40. + shades[0] = ColorUtils.CAMToColor(hue, Math.min(40f, chroma), 99); + shades[1] = ColorUtils.CAMToColor(hue, Math.min(40f, chroma), 95); for (int i = 2; i < 12; i++) { float lStar = (i == 6) ? MIDDLE_LSTAR : 100 - 10 * (i - 1); + if (lStar >= 90) { + chroma = Math.min(40f, chroma); + } shades[i] = ColorUtils.CAMToColor(hue, chroma, lStar); } return shades;