Menu - Top - Home - Donate to Me

com.upokecenter.util.ColorValidator

com.upokecenter.util.ColorValidator

public final class ColorValidator extends Object

Contains methods to convert between different representations of HTML and CSS colors.

Methods

Method Details

HlsToRgb

public static double[] HlsToRgb(double[] hls)

Converts a color in the HLS color space to red/green/blue.

Parameters:

Returns:

Throws:

ColorHtmlToRgba

public static double[] ColorHtmlToRgba(String x)

Converts HTML colors to Red/Green/Blue colors.

Parameters:

Returns:

Throws:

ColorToRgba

public static double[] ColorToRgba(String x)

Not documented yet.

Parameters:

Returns:

ColorToRgb

public static double[] ColorToRgb(String x)

Converts HTML colors to Red/Green/Blue colors. Use this function to parse colors from normal color picker controls: http://peteroupc.github.com/colorpicker/.

Parameters:

Returns:

RgbToColor

public static String RgbToColor(double[] arrayRGB)

Converts an RGBA color to a string, either rgb(...) or rgba(...) as applicable.

Parameters:

Returns:

Throws:

RgbToColorDisplay

public static String RgbToColorDisplay(double[] rgb)

Converts a red-green-blue-alpha color to a string in CSS format.

Parameters:

Returns:

Throws:

RgbToColorHtml

public static String RgbToColorHtml(double[] rgb)

Converts an RGBA color to an HTML color, (ex. #002233)."rgb" must contain at least 3 elements: the red, green, and blue (each 0-255).

Parameters:

Returns:

Throws:

RgbToColorHtml

public static String RgbToColorHtml(double r, double g, double b)

Converts a red-green-blue color to a string in HTML format.

Parameters:

Returns:

Back to colorvalidator start page.