code: static double getColor( Expression param, CssFormatter formatter ) throws LessException {
          switch( param.getDataType( formatter ) ) {
              case Expression.COLOR:
              case Expression.RGBA:
                  return param.doubleValue( formatter );
          }
          throw new LessException( "Not a color: " + param );
      }
docs: Get the color value of the expression or fire an exception if not a color.
  
  @param param the expression to evaluate
  @param formatter current formatter
  @return the color value of the expression
  @throws LessException if the expression is not a color value