public int astolfo(int speed, int index) {
double angle = (int) ((System.currentTimeMillis() / speed + index) % 360);
return Color.getHSBColor(
((angle %= 360) / 360.0) < 0.5 ? -((float) (angle / 360.0)) : (float) (angle / 360.0),
0.5F,
1.0F
).hashCode();
}
public int rainbow(int speed, int index, float saturation, float brightness, float opacity) {
int angle = (int) ((System.currentTimeMillis() / speed + index) % 360);
float hue = angle / 360f;
int color = Color.HSBtoRGB(hue, saturation, brightness);
return getColor(
red(color),
green(color),
blue(color),
Math.max(0, Math.min(255, (int) (opacity * 255)))
);
}