code: public static int[] RGBtoHSV (float r, float g, float b) {
  		float h, s, v;
  		float min, max, delta;
  
  		min = Math.min(Math.min(r, g), b);
  		max = Math.max(Math.max(r, g), b);
  		v = max;
  
  		delta = max - min;
  
  		if (max != 0)
  			s = delta / max;
  		else {
  			s = 0;
  			h = 0;
  			return new int[]{MathUtils.round(h), MathUtils.round(s), MathUtils.round(v)};
  		}
  
  		if (delta == 0)
  			h = 0;
  		else {
  
  			if (r == max)
  				h = (g - b) / delta;
  			else if (g == max)
  				h = 2 + (b - r) / delta;
  			else
  				h = 4 + (r - g) / delta;
  		}
  
  		h *= 60;
  		if (h < 0)
  			h += 360;
  
  		s *= 100;
  		v *= 100;
  
  		return new int[]{MathUtils.round(h), MathUtils.round(s), MathUtils.round(v)};
  	}
docs: Converts RGB to HSV color system
  @param r red 0-1
  @param g green 0-1
  @param b blue 0-1
  @return 3 element int array with hue (0-360), saturation (0-100) and value (0-100)