code: public Color getExpectedColorParam(int index) {
          Expression expr = getExpectedParam(index);
          if (!(expr instanceof Color)) {
              throw new IllegalArgumentException("Parameter " + index + " isn't a color. Function call: " + this);
          }
  
          return (Color) expr;
      }
docs: Returns the parameter casted as a {@link Color} at the expected index.
  
  @param index the number of the parameter to access
  @return the expression representing at the given index
  @throws IllegalArgumentException if the index is out of bounds or if the parameter isn't a color