ColorTranslator

Inheritance: java.lang.Object

public final class ColorTranslator

Translates colors to and from GDI+ Color structures. This class cannot be inherited.

Constructors

ConstructorDescription
ColorTranslator()

Methods

MethodDescription
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:

ParameterTypeDescription
htmlColorjava.lang.StringThe 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:

ParameterTypeDescription
cColorThe 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:

ParameterTypeDescription
win32ColorintThe 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:

ParameterTypeDescription
oleColorintThe 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:

ParameterTypeDescription
cColorColor 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:

ParameterTypeDescription
cColorColor structure to convert.

Returns: int - Value that represent OLE format of color.