Convetrs the CSS parser color representation to the AWT color used by CSSBox.
@param src Source CSS parser color representation
@return the resulting AWT color
484720
public static java.awt.Color convertColor(cz.vutbr.web.csskit.Color src)
    {
        return new java.awt.Color(src.getRGB(), true);
    }
247724
public static String processColor(String color) {
    	log.info("Process Color [{}].", color);
    	String colorRtn = null;
    	if (StringUtils.isNotBlank(color)) {
    		HSSFColor poiColor = null;
    		// #rgb -> #rrggbb
    		if (color.matches(COLOR_PATTERN_VALUE_SHORT)) {
    			log.debug("Short Hex Color [{}] Found.", color);
    			StringBuffer sbColor = new StringBuffer();
    			Matcher m = Pattern.compile("([a-f]|\\d)").matcher(color);
    			while (m.find()) {
    				m.appendReplacement(sbColor, "$1$1");
    			}
    			colorRtn = sbColor.toString();
    			log.debug("Translate Short Hex Color [{}] To [{}].", color, colorRtn);
    		}
    		// #rrggbb
    		else if (color.matches(COLOR_PATTERN_VALUE_LONG)) {
    			colorRtn = color;
    			log.debug("Hex Color [{}] Found, Return.", color);
    		}
    		// rgb(r, g, b)
    		else if (color.matches(COLOR_PATTERN_RGB)) {
    			Matcher m = Pattern.compile(COLOR_PATTERN_RGB).matcher(color);
    			if (m.matches()) {
    				log.debug("RGB Color [{}] Found.", color);
    				colorRtn = convertColor(calcColorValue(m.group(2)),
    							calcColorValue(m.group(3)),
    							calcColorValue(m.group(4)));
    				log.debug("Translate RGB Color [{}] To Hex [{}].", color, colorRtn);
    			}
    		}
    		// color name, red, green, ...
    		else if ((poiColor = getColor(color)) != null) {
    			log.debug("Color Name [{}] Found.", color);
    			short[] t = poiColor.getTriplet();
    			colorRtn = convertColor(t[0], t[1], t[2]);
    			log.debug("Translate Color Name [{}] To Hex [{}].", color, colorRtn);
    		}
    	}
    	return colorRtn;
    }
311164
private double getColor( Expression exp, CssFormatter formatter ) {
        type = exp.getDataType( formatter );
        switch( type ) {
            case COLOR:
            case RGBA:
                return exp.doubleValue( formatter );
        }
        throw new ParameterOutOfBoundsException();
    }
903511
def color(color_code) # :nodoc:
      if color_code and color_code =~ /^#[0-9a-fA-F]{6}$/
        # Convert a HTML style #RRGGBB color.
        color_code.sub(/^#/, '').upcase
      else
        index = Format.color(color_code)
        raise "Unknown color '#{color_code}' used in chart formatting." unless index
        palette_color(index)
      end
    end
978782
public static String toRGB(Color color)
    {
        String rgb = "#";
        rgb += formatAsHex( color.getRed() );
        rgb += formatAsHex( color.getGreen() );
        rgb += formatAsHex( color.getBlue() );
        return rgb;
    }
855893
private int getSrcColor(int x, int y) {
        int argb = srcColorModel.getRGB(srcRaster.getDataElements(x, y, null));
        if (transparency == Transparency.OPAQUE) {
            argb = 0xff000000 | argb;
        }

        return argb;
    }
1128904
function (src) {
    if (isConstant(src)) {
      return this.buffer(toConstant(src) + '')
    }
    var body = this.parseExpr(src);
    var ast = this.ast_buffer(body);
    return ast;
  }
1170435
public static Color stringToColor(String str) {
    int icol = SVG_COLOR_NAMES.getInt(str.toLowerCase());
    if(icol != NO_VALUE) {
      return new Color(icol, false);
    }
    return colorLookupStylesheet.stringToColor(str);
  }
905817
@Nullable
  public static CSSRect getAsRect (@Nullable final String sCSSValue)
  {
    final String [] aValues = getRectValues (sCSSValue);
    return aValues == null ? null : new CSSRect (aValues[0], aValues[1], aValues[2], aValues[3]);
  }
316591
public static Color rgbToColorConverter(final String value) {

        if (StringUtils.isEmpty(value) || (!StringUtils.isEmpty(value) && !value.startsWith("rgb"))) {
            throw new IllegalArgumentException(
                    "String to convert is empty or of invalid format - value: '" + value + "'");
        }

        // RGB color format rgb/rgba(255,255,255,0.1)
        final String[] colors = value.substring(value.indexOf('(') + 1, value.length() - 1).split(",");
        final int red = Integer.parseInt(colors[0]);
        final int green = Integer.parseInt(colors[1]);
        final int blue = Integer.parseInt(colors[2]);
        if (colors.length > 3) {
            final int alpha = (int) (Double.parseDouble(colors[3]) * 255D);
            return new Color(red, green, blue, alpha);
        }
        return new Color(red, green, blue);
    }
100485
private void checkAsCss(InputSource is) throws IOException, SAXException {
        String charset = "UTF-8";
        if (is.getEncoding() != null) {
            charset = is.getEncoding();
        }
        List<InputStream> streamsList = new ArrayList<>();
        streamsList.add(new ByteArrayInputStream(CSS_CHECKING_PROLOG));
        streamsList.add(is.getByteStream());
        streamsList.add(new ByteArrayInputStream(CSS_CHECKING_EPILOG));
        Enumeration<InputStream> streams = Collections.enumeration(streamsList);
        is.setByteStream(new SequenceInputStream(streams));
        is.setEncoding(charset);
        sourceCode.setIsCss();
        sourceCode.initialize(is);
        try {
            htmlReader.parse(is);
        } catch (SAXParseException e) {
        }
    }
1144146
@Pure
	public static String toColor(int red, int green, int blue, int alpha) {
		return toColor(encodeRgbaColor(red, green, blue, alpha));
	}
1133212
function ColorSpace_getRgb(src, srcOffset) {
      var rgb = new Uint8Array(3);
      this.getRgbItem(src, srcOffset, rgb, 0);
      return rgb;
    }
993169
public static CssSel sel(String selector, String value) {
	return j.sel(selector, value);
    }
1154599
public void setCssText(final String cssText) throws DOMException {
        try {
            final CSSOMParser parser = new CSSOMParser();
            properties_.clear();
            parser.parseStyleDeclaration(this, cssText);
        }
        catch (final Exception e) {
            throw new DOMExceptionImpl(
                DOMException.SYNTAX_ERR,
                DOMExceptionImpl.SYNTAX_ERROR,
                e.getMessage());
        }
    }
935354
public static Color HSVtoRGB (float h, float s, float v, float alpha) {
		Color c = HSVtoRGB(h, s, v);
		c.a = alpha;
		return c;
	}
1117471
public static final StyleSheet parse(URL url, String encoding)
			throws CSSException, IOException {
		return getCSSParserFactory().parse(url, getNetworkProcessor(), encoding, SourceType.URL, url);
	}