var fanObject = {
  init: function (that, rateResult, fanSize, fanScale, color1, color2, ShowNumber) {
    
    var rate=rateResult;
    var angle1 = (360 * rate), angle2 = 0, bgColor = "background-color:" + color2;
    if (rate > 0.5) {
      angle1 = 180;
      angle2 = (360 * (rate - 0.5) - 180);
      bgColor = "background-color:" + color1;
    }
    else {
      bgColor = "background-color:" + color2;
    }

    that.setData({
      Angle1: angle1,
      Angle2: angle2,
      BGColor: bgColor,
      FanSize: fanSize,
      FanScale: fanScale,
      Color1: color1,
      Color2: color2,
      ShowNumber: ShowNumber,
    });

  },
  init2: function (that, rateResult2, fanSize2, fanScale2, color12, color22, ShowNumber2) {
    
    var rate2 = rateResult2;
    var angle12 = (360 * rate2), angle22 = 0, bgColor2 = "background-color:" + color22;
    if (rate2 > 0.5) {
      angle12 = 180;
      angle22 = (360 * (rate2 - 0.5) - 180);
      bgColor2 = "background-color:" + color12;
    }
    else {
      bgColor2 = "background-color:" + color22;
    }

    that.setData({
      Angle12: angle12,
      Angle22: angle22,
      BGColor2: bgColor2,
      FanSize2: fanSize2,
      FanScale2: fanScale2,
      Color12: color12,
      Color22: color22,
      ShowNumber2: ShowNumber2,
    });

  }
}
export default fanObject;