ColorTranslator
Inheritance: java.lang.Object
public final class ColorTranslator
Translates colors to and from GDI+ Color structures. This class cannot be inherited.
Constructors
Constructor | Description |
---|---|
ColorTranslator() |
Methods
Method | Description |
---|---|
fromHtml(String htmlColor) | Translates an HTML color representation to a GDI+ Color structure. |
toHtml(Color c) | Translates the specified Color structure to an HTML string color representation. |
fromWin32(int win32Color) | Translates a Windows color value to a GDI+ Color structure. |
fromOle(int oleColor) | Translates an OLE color value to a GDI+ Color structure. |
toWin32(Color c) | Converts Color structure to Win32 presentation of color. |
toOle(Color c) | Converts Color structure to OLE presentation of color. |
ColorTranslator()
public ColorTranslator()
fromHtml(String htmlColor)
public static Color fromHtml(String htmlColor)
Translates an HTML color representation to a GDI+ Color structure.
Parameters:
Parameter | Type | Description |
---|---|---|
htmlColor | java.lang.String | The string representation of the Html color to translate. |
Returns:
Color - The Color structure that represents the translated HTML color or Empty
if htmlColor is null.
toHtml(Color c)
public static String toHtml(Color c)
Translates the specified Color structure to an HTML string color representation.
Parameters:
Parameter | Type | Description |
---|---|---|
c | Color | The Color structure to translate. |
Returns: java.lang.String - The string that represents the HTML color.
fromWin32(int win32Color)
public static Color fromWin32(int win32Color)
Translates a Windows color value to a GDI+ Color structure.
Parameters:
Parameter | Type | Description |
---|---|---|
win32Color | int | The Windows color to translate. |
Returns: Color - The Color structure that represents the translated Windows color.
fromOle(int oleColor)
public static Color fromOle(int oleColor)
Translates an OLE color value to a GDI+ Color structure.
Parameters:
Parameter | Type | Description |
---|---|---|
oleColor | int | The OLE color to translate. |
Returns: Color - The Color structure that represents the translated OLE color.
toWin32(Color c)
public static int toWin32(Color c)
Converts Color structure to Win32 presentation of color.
Parameters:
Parameter | Type | Description |
---|---|---|
c | Color | Color structure to convert. |
Returns: int - Value that represent Win32 format of color.
toOle(Color c)
public static int toOle(Color c)
Converts Color structure to OLE presentation of color.
Parameters:
Parameter | Type | Description |
---|---|---|
c | Color | Color structure to convert. |
Returns: int - Value that represent OLE format of color.