publicstaticdouble[] newRgb2hsb(int red, int green, int blue) {
double b, delta, g, max, min, r;
double hue, saturation, luminosity;
r = (double) red / MaxRGB; g = (double) green / MaxRGB; b = (double) blue / MaxRGB; max = Math.max(r, Math.max(g, b)); min = Math.min(r, Math.min(g, b));
hue = 0.0; saturation = 0.0; luminosity = max;
delta = max - min; if (delta == 0.0) { returnnewdouble[]{hue, saturation, luminosity}; }