Use the Color
constructor that takes a value with an alpha channel. Specifically, first you convert your color coordinates to RGB space:
int rgba = Color.HSBtoRGB(H, S, B);
and then add the desired amount of transparency,
rgba = (rgba & 0xffffff) | (alpha << 24);
where alpha
is an integer between 0 (fully transparent) and 255 (fully opaque), inclusive. This value you can pass to the Color
constructor, making sure to give true
for the second argument.
Color c = new Color(rgba, true);