Class mxHtmlColor
java.lang.Object
com.mxgraph.util.mxHtmlColor
Contains various helper methods for use with mxGraph.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetHexColorString(Color color) Returns a hex representation for the given color.static Stringprotected static floatparseAlpha(String alpha) static ColorparseColor(String str) Shortcut for parseColor with no transparency.static ColorparseColor(String str, double alpha) Convert a string representing a 24/32bit hex color value into a Color object.protected static doubleparsePercent(String perc) protected static Colorprotected static floatparseValue(String val, int max)
-
Field Details
-
htmlColors
-
rgbRegex
-
-
Constructor Details
-
mxHtmlColor
public mxHtmlColor()
-
-
Method Details
-
hexString
-
getHexColorString
-
parseColor
Shortcut for parseColor with no transparency.- Throws:
NumberFormatException
-
parseColor
Convert a string representing a 24/32bit hex color value into a Color object. All 147 CSS color names and none are also supported. None returns null. Examples of possible hex color values are: #C3D9FF, #6482B9 and #774400, but note that you do not include the "#" in the string passed in- Parameters:
str- the 24/32bit hex string value (ARGB)- Returns:
- java.awt.Color (24bit RGB on JDK 1.1, 24/32bit ARGB on JDK1.2)
- Throws:
NumberFormatException- if the specified string cannot be interpreted as a hexidecimal integer
-
parseRgb
-
parseValue
-
parsePercent
-
parseAlpha
-