com.mxgraph.util
Class mxHtmlColor
- java.lang.Object
-
- com.mxgraph.util.mxHtmlColor
-
public class mxHtmlColor extends java.lang.ObjectContains various helper methods for use with mxGraph.
-
-
Constructor Summary
Constructors Constructor and Description mxHtmlColor()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.StringgetHexColorString(java.awt.Color color)Returns a hex representation for the given color.static java.lang.StringhexString(java.awt.Color color)static java.awt.ColorparseColor(java.lang.String str)Shortcut for parseColor with no transparency.static java.awt.ColorparseColor(java.lang.String str, double alpha)Convert a string representing a 24/32bit hex color value into a Color object.
-
-
-
Method Detail
-
hexString
public static java.lang.String hexString(java.awt.Color color)
-
getHexColorString
public static java.lang.String getHexColorString(java.awt.Color color)
Returns a hex representation for the given color.- Parameters:
color- Color to return the hex string for.- Returns:
- Returns a hex string for the given color.
-
parseColor
public static java.awt.Color parseColor(java.lang.String str) throws java.lang.NumberFormatExceptionShortcut for parseColor with no transparency.- Throws:
java.lang.NumberFormatException
-
parseColor
public static java.awt.Color parseColor(java.lang.String str, double alpha) throws java.lang.NumberFormatExceptionConvert 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:
java.lang.NumberFormatException- if the specified string cannot be interpreted as a hexidecimal integer
-
-
DataMelt 3.0 © DataMelt by jWork.ORG