setGradient({
    vector,
    colors: gradientColors,
    type = 'fill'
  } = {}) {
    gradientColors = gradientColors.map(({
      offset,
      color
    }) => {
      if (typeof color === 'string') color = Object(_utils_parse_color__WEBPACK_IMPORTED_MODULE_10__["default"])(color);
      return {
        offset,
        color
      };
    });
    this[_gradient] = this[_gradient] || {};
    this[_gradient][type] = {
      vector,
      colors: gradientColors
    };
    gradientColors.sort((a, b) => {
      return a.offset - b.offset;
    });
    const colorSteps = [];
    gradientColors.forEach(({
      offset,
      color
    }) => {
      colorSteps.push(offset, ...color);
    });

    let _vector;

    if (vector.length === 4) {
      // linear gradient;
      _vector = [vector[0], vector[1], 0, vector[2], vector[3], 0];
    } else {
      _vector = [...vector];
    }

    if (colorSteps.length < 40) colorSteps.push(-1);
    if (colorSteps.length > 40) throw new Error('Too many colors, should be less than 8 colors');
    this._radialGradientVector = _vector;
    this[_uniforms].u_colorSteps = colorSteps;
    if (type === 'fill') this[_uniforms].u_gradientType = 1;else this[_uniforms].u_gradientType = 0;

    this[_applyGradientTransform]();

    return this;
  }
vector: [x0, y0, r0, x1, y1, r1],
    colors: [{offset:0, color}, {offset:1, color}, ...],