public class mxHtmlColor extends Object
Modifier and Type | Field and Description |
---|---|
protected static HashMap<String,Color> |
htmlColors
HTML color lookup table.
|
protected static Pattern |
rgbRegex |
Constructor and Description |
---|
mxHtmlColor() |
Modifier and Type | Method and Description |
---|---|
static String |
getHexColorString(Color color)
Returns a hex representation for the given color.
|
static String |
hexString(Color color) |
protected static float |
parseAlpha(String alpha) |
static Color |
parseColor(String str)
Convert a string representing a 24/32bit hex color value into a Color
object.
|
protected static double |
parsePercent(String perc) |
protected static Color |
parseRgb(String rgbString) |
protected static float |
parseValue(String val,
int max) |
protected static HashMap<String,Color> htmlColors
protected static final Pattern rgbRegex
public static String getHexColorString(Color color)
color
- Color to return the hex string for.public static Color parseColor(String str) throws NumberFormatException
str
- the 24/32bit hex string value (ARGB)NumberFormatException
- if the specified string cannot be interpreted as a
hexidecimal integerprotected static float parseValue(String val, int max)
protected static double parsePercent(String perc)
protected static float parseAlpha(String alpha)
Copyright (c) 2010 Gaudenz Alder. All rights reserved.