code: private static double calculateHue(double red, double green, double blue, double max, double chroma) {
  
      if (chroma == 0) {
        return 0;
      } else {
        double hue;
        if (red == max) {
          hue = (green - blue) / chroma;
        } else if (green == max) {
          hue = (blue - red) / chroma + 2;
        } else {
          hue = (red - green) / chroma + 4;
        }
        hue = hue * 60.0;
        if (hue < 0) {
          hue = hue + Hue.MAX_VALUE;
        }
        return hue;
      }
    }
docs: Calculate the {@link Hue}.
  
  @param red is the {@link Red} value.
  @param green is the {@link Green} value.
  @param blue is the {@link Blue} value.
  @param max is the maximum of RGB.
  @param chroma is the {@link Chroma} value.
  @return the {@link Saturation}.