code: function (r, g, b) { // !!! this function returns x,y,z not h,s,v
      var n = Math.min(Math.min(r, g), b),
        v = Math.max(Math.max(r, g), b),
        m = v - n,
        h = 0;
      if (m === 0) return [0, 0, v];
      h = r === n ? 3 + (b - g) / m : (g === n ? 5 + (r - b) / m : 1 + (g - r) / m);
      return [h === 6 ? 0 : h * 42.5, m / v * 255, v];
    }
docs: attribute definitions