code: public void setForegroundColors(int[] colors) {
          if (colors.length < _corners) {
              throw new IllegalArgumentException(String.format(Locale.getDefault(),
                      "Not enough foreground colors, your corners is %d.", _corners));
          }
          _foreground_colors = new int[colors.length];
          System.arraycopy(colors, 0, _foreground_colors, 0, colors.length);
  
          // 重新画
          invalidate();
      }
docs: 动态设置前景颜色