function RGBtoHSV(r, g, b) {
  if (arguments.length == 1) {
    var { r, g, b } = arguments[0];
  }

  const R1 = r / 255;
  const G1 = g / 255;
  const B1 = b / 255;

  const MaxC = Math.max(R1, G1, B1);
  const MinC = Math.min(R1, G1, B1);

  const DeltaC = MaxC - MinC;

  var H = 0;

  if (DeltaC == 0) {
    H = 0;
  } else if (MaxC == R1) {
    H = 60 * (((G1 - B1) / DeltaC) % 6);
  } else if (MaxC == G1) {
    H = 60 * ((B1 - R1) / DeltaC + 2);
  } else if (MaxC == B1) {
    H = 60 * ((R1 - G1) / DeltaC + 4);
  }

  if (H < 0) {
    H = 360 + H;
  }

  var S = 0;

  if (MaxC == 0) S = 0;
  else S = DeltaC / MaxC;

  var V = MaxC;

  return { h: H, s: S, v: V };
}
@method RGBtoHSV

convert rgb to hsv

		color.RGBtoHSV(0, 0, 255) === { h : 240, s : 1, v : 1 } === '#FFFF00'

@param {Number} R  red color value
@param {Number} G  green color value
@param {Number} B  blue color value
@return {Object}  hsv color code