code: public void setForegroundValues(int[] values) {
          if (values.length < _corners) {
              throw new IllegalArgumentException(String.format(Locale.getDefault(),
                      "Not enough foreground values, your corners is %d.", _corners));
          }
          _foreground_values = new int[values.length];
          System.arraycopy(values, 0, _foreground_values, 0, values.length);
  
          invalidate();
      }
docs: 动态设置前景值列表