You can't create new colors based on HSB values, becuase Color.HSBtoRGB and Color.testColorValueRange(int rgb) disagree on whether the symbolicFlag mask should be part of the RGB value or not. HSBtoRGB ORs in the mask, which
creates a negative int that testColorValueRange doesn't like.
=========================================================================
import java.awt.Color;
public class ColorTest {
public static void main(String[] argv) {
// All values will throw exception:
Color c0 = new Color(Color.HSBtoRGB(0, 0, 0));
// All values will throw exception:
Color c1 = Color.getHSBColor(0, 0, 0);
}
}
=========================================================================
creates a negative int that testColorValueRange doesn't like.
=========================================================================
import java.awt.Color;
public class ColorTest {
public static void main(String[] argv) {
// All values will throw exception:
Color c0 = new Color(Color.HSBtoRGB(0, 0, 0));
// All values will throw exception:
Color c1 = Color.getHSBColor(0, 0, 0);
}
}
=========================================================================