From 6d052910b91d88ada9b0395acbff785f52247821 Mon Sep 17 00:00:00 2001 From: Andy Scherzinger Date: Mon, 27 Oct 2025 11:41:57 +0100 Subject: [PATCH] chore: Automated Code Change sync 21/10/2025 Signed-off-by: Andy Scherzinger --- .../src/main/java/dynamiccolor/DynamicColor.java | 2 +- .../java/dynamiccolor/MaterialDynamicColors.java | 2 +- .../main/java/temperature/TemperatureCache.java | 15 ++++++--------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/material-color-utilities/src/main/java/dynamiccolor/DynamicColor.java b/material-color-utilities/src/main/java/dynamiccolor/DynamicColor.java index 4b087aa6..754fb23a 100644 --- a/material-color-utilities/src/main/java/dynamiccolor/DynamicColor.java +++ b/material-color-utilities/src/main/java/dynamiccolor/DynamicColor.java @@ -51,7 +51,7 @@ // A java_library Bazel rule with an Android constraint cannot skip these warnings without this // annotation; another solution would be to create an android_library rule and supply // AndroidManifest with an SDK set higher than 14. -@SuppressWarnings({"AndroidJdkLibsChecker", "NewApi"}) +@SuppressWarnings("NewApi") public final class DynamicColor { public final String name; public final Function palette; diff --git a/material-color-utilities/src/main/java/dynamiccolor/MaterialDynamicColors.java b/material-color-utilities/src/main/java/dynamiccolor/MaterialDynamicColors.java index 278520b7..934734eb 100644 --- a/material-color-utilities/src/main/java/dynamiccolor/MaterialDynamicColors.java +++ b/material-color-utilities/src/main/java/dynamiccolor/MaterialDynamicColors.java @@ -28,7 +28,7 @@ // A java_library Bazel rule with an Android constraint cannot skip these warnings without this // annotation; another solution would be to create an android_library rule and supply // AndroidManifest with an SDK set higher than 14. -@SuppressWarnings({"AndroidJdkLibsChecker", "NewApi"}) +@SuppressWarnings("NewApi") public final class MaterialDynamicColors { private static final ColorSpec colorSpec = new ColorSpec2025(); diff --git a/material-color-utilities/src/main/java/temperature/TemperatureCache.java b/material-color-utilities/src/main/java/temperature/TemperatureCache.java index f082acc1..57e0e804 100644 --- a/material-color-utilities/src/main/java/temperature/TemperatureCache.java +++ b/material-color-utilities/src/main/java/temperature/TemperatureCache.java @@ -48,8 +48,8 @@ private TemperatureCache() { * Create a cache that allows calculation of ex. complementary and analogous colors. * * @param input Color to find complement/analogous colors of. Any colors will have the same tone, - * and chroma as the input color, modulo any restrictions due to the other hues having lower - * limits on chroma. + * and chroma as the input color, modulo any restrictions due to the other hues having lower + * limits on chroma. */ public TemperatureCache(Hct input) { this.input = input; @@ -83,14 +83,12 @@ public Hct getComplement() { // Find the color in the other section, closest to the inverse percentile // of the input color. This is the complement. for (double hueAddend = 0.; hueAddend <= 360.; hueAddend += 1.) { - double hue = MathUtils.sanitizeDegreesDouble( - startHue + directionOfRotation * hueAddend); + double hue = MathUtils.sanitizeDegreesDouble(startHue + directionOfRotation * hueAddend); if (!isBetween(hue, startHue, endHue)) { continue; } Hct possibleAnswer = getHctsByHue().get((int) Math.round(hue)); - double relativeTemp = - (getTempsByHct().get(possibleAnswer) - coldestTemp) / range; + double relativeTemp = (getTempsByHct().get(possibleAnswer) - coldestTemp) / range; double error = Math.abs(complementRelativeTemp - relativeTemp); if (error < smallestError) { smallestError = error; @@ -217,8 +215,7 @@ public List getAnalogousColors(int count, int divisions) { */ public double getRelativeTemperature(Hct hct) { double range = getTempsByHct().get(getWarmest()) - getTempsByHct().get(getColdest()); - double differenceFromColdest = - getTempsByHct().get(hct) - getTempsByHct().get(getColdest()); + double differenceFromColdest = getTempsByHct().get(hct) - getTempsByHct().get(getColdest()); // Handle when there's no difference in temperature between warmest and // coldest: for example, at T100, only one color is available, white. if (range == 0.) { @@ -284,7 +281,7 @@ private List getHctsByHue() { // A java_library Bazel rule with an Android constraint cannot skip these warnings without this // annotation; another solution would be to create an android_library rule and supply // AndroidManifest with an SDK set higher than 23. - @SuppressWarnings({"AndroidJdkLibsChecker", "NewApi"}) + @SuppressWarnings("NewApi") private List getHctsByTemp() { if (precomputedHctsByTemp != null) { return precomputedHctsByTemp;