public double getG() { return getGreen() / 255.0D; }
public boolean hasName() { return getName() != null; }
public double getB() { return getBlue() / 255.0D; }
@Nonnull public Gradient withAlpha(int alpha) { return new Gradient(getPrimary().withAlpha(alpha), getSecondary().withAlpha(alpha)); }
@Nonnull @Override protected Object[] stringValues() { return new Object[] { hashCode() }; }
public double getR() { return getRed() / 255.0D; }
@Nonnull @Override protected Object[] stringValues() { return new Object[] { getPrimary(), getSecondary() }; } }
@Nonnull @Override public Object serialize(@Nonnull Color value) { return "#" + value.toHash(); } };
public double getA() { return getAlpha() / 255.0D; }
@Nonnull public Color brighten() { return brighten(0.3D); }
@Nonnull public Color darken() { return darken(0.3D); }
@Nonnull public Color withAlpha(int alpha) { return ColorCache.createCached(this, alpha); }
@Nonnull public Gradient withAlpha(double alpha) { return new Gradient(getPrimary().withAlpha(alpha), getSecondary().withAlpha(alpha)); }
public Color(double red, double green, double blue, double alpha) { this.alpha = (int) (Math.min(1.0D, Math.max(0.0D, alpha)) * 0xFF); this.blue = (int) (Math.min(1.0D, Math.max(0.0D, blue)) * 0xFF); this.green = (int) (Math.min(1.0D, Math.max(0.0D, green)) * 0xFF); this.red = (int) (Math.min(1.0D, Math.max(0.0D, red)) * 0xFF); this.hash = getAlpha() << 24 | getRed() << 16 | getGreen() << 8 | getBlue(); }