code: function(rgbValue) {
  
              var max = null,
                  min = null,
                  result = {};
  
              rgbValue = Utils.extend({}, rgbValue);
  
              rgbValue.r = rgbValue.r / 255;
              rgbValue.g = rgbValue.g / 255;
              rgbValue.b = rgbValue.b / 255;
  
              max = Math.max(rgbValue.r, rgbValue.g, rgbValue.b);
              min = Math.min(rgbValue.r, rgbValue.g, rgbValue.b);
  
              //h分量计算
              if (max === min) {
  
                  result.h = 0;
  
              } else if (max === rgbValue.r) {
  
                  if (rgbValue.g >= rgbValue.b) {
  
                      result.h = 60 * (rgbValue.g - rgbValue.b) / (max - min);
  
                  } else {
  
                      result.h = 60 * (rgbValue.g - rgbValue.b) / (max - min) + 360;
  
                  }
  
              } else if (max === rgbValue.g) {
  
                  result.h = 60 * (rgbValue.b - rgbValue.r) / (max - min) + 120;
  
              } else if (max === rgbValue.b) {
  
                  result.h = 60 * (rgbValue.r - rgbValue.g) / (max - min) + 240;
  
              }
  
              //l分量计算
              result.l = (max + min) / 2;
  
              //s分量计算
              if (result.l === 0 || max === min) {
  
                  result.s = 0;
  
              } else if (result.l > 0 && result.l <= 0.5) {
  
                  result.s = (max - min) / (max + min);
  
              } else {
  
                  result.s = (max - min) / (2 - max - min);
  
              }
  
              //格式化hsl结果
  
              result.h = Math.round(result.h);
              result.s = Math.round(result.s * 100);
              result.l = Math.round(result.l * 100);
  
              return result;
  
          }
docs: rgb值对象转换为hsl值对象