From 8814046864a2310903e3c9a6c2451d9300fa1a46 Mon Sep 17 00:00:00 2001 From: zheng sen he <61687266+meteorOSS@users.noreply.github.com> Date: Sat, 3 Feb 2024 03:36:53 +0800 Subject: [PATCH] fix: single char error --- src/main/java/com/iridium/iridiumcolorapi/IridiumColorAPI.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/iridium/iridiumcolorapi/IridiumColorAPI.java b/src/main/java/com/iridium/iridiumcolorapi/IridiumColorAPI.java index 9633735..efdaa0b 100644 --- a/src/main/java/com/iridium/iridiumcolorapi/IridiumColorAPI.java +++ b/src/main/java/com/iridium/iridiumcolorapi/IridiumColorAPI.java @@ -232,6 +232,7 @@ private static ChatColor[] createRainbow(int step, float saturation) { */ @Nonnull private static ChatColor[] createGradient(@Nonnull Color start, @Nonnull Color end, int step) { + step = Math.max(step,2); ChatColor[] colors = new ChatColor[step]; int stepR = Math.abs(start.getRed() - end.getRed()) / (step - 1); int stepG = Math.abs(start.getGreen() - end.getGreen()) / (step - 1);