code: public void setAnchorColor(int index, Color color) {
          if (index <= 0) {
              if (startColor == null) {
                  startColor = new RGBColor(0.0, 0.0, 0.0);
              }
              setGradation(true);
              this.startColor = color;
          } else if (index >= 1) {
              if (endColor == null) {
                  endColor = new RGBColor(0.0, 0.0, 0.0);
              }
              setGradation(true);
              this.endColor = color;
          }
      }
docs: Sets the color of the anchor point for gradation.
  
  @param index The index of anchors. The index of the start anchor point is 0, the index of the
  end anchor point is 1.
  
  @param color The color of the anchor point.