mirror of
https://github.com/TotalFreedomMC/PlayerParticles.git
synced 2025-02-11 03:29:53 +00:00
Fix off by 1 for hex colors when stopping at end of string
This commit is contained in:
parent
3a441e3329
commit
4474c4354c
1 changed files with 7 additions and 1 deletions
|
@ -154,7 +154,7 @@ public final class HexUtils {
|
|||
if (matcher.start() > searchAfter)
|
||||
return matcher.start();
|
||||
}
|
||||
return content.length() - 1;
|
||||
return content.length();
|
||||
}
|
||||
|
||||
private static String cleanHex(String hex) {
|
||||
|
@ -270,6 +270,9 @@ public final class HexUtils {
|
|||
this.step = this.stepIndex = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the next color in the gradient
|
||||
*/
|
||||
public Color next() {
|
||||
// Gradients will use the first color of the entire spectrum won't be available to preserve prettiness
|
||||
if (NMSUtil.getVersionNumber() < 16)
|
||||
|
@ -344,6 +347,9 @@ public final class HexUtils {
|
|||
this(totalColors, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the next color in the gradient
|
||||
*/
|
||||
public Color next() {
|
||||
Color color = Color.getHSBColor(this.hue, this.saturation, this.brightness);
|
||||
this.hue += this.hueStep;
|
||||
|
|
Loading…
Reference in a new issue