code: private double getColor( Expression exp, CssFormatter formatter ) {
          type = exp.getDataType( formatter );
          switch( type ) {
              case COLOR:
              case RGBA:
                  return exp.doubleValue( formatter );
          }
          throw new ParameterOutOfBoundsException();
      }
docs: Get a color value from the expression. And set the type variable.
  
  @param exp
  the expression
  @param formatter
  current formatter
  @return the the color value
  @throws ParameterOutOfBoundsException if the parameter with the index does not exists