org.das2.util.ColorUtil

single place to contain Color-Name mapping. These include an old set of 10 or so color names, plus the 130 or so web color names like "SaddleBrown" and "DarkOrchid".


decodeColor

decodeColor( String s ) → Color

decode the color, throwing a RuntimeException when the color is not parsable. Valid entries include:

This also allows a color name to follow the RGB like so: to improve legibility of .vap files. X11 color names can be found at wikipedia.

Parameters

s - the string representation

Returns:

the color

See Also:

https://en.wikipedia.org/wiki/X11_color_names
http://cng.seas.rochester.edu/CNG/docs/x11color.html


search for examples view on GitHub view source


encodeColor

encodeColor( java.awt.Color color ) → String

return either a named color or #00aaff for opaque colors and #80aaff00 for transparent colors.

Parameters

color -

Returns:

named color or hex string like "#FF0000" for Red.

search for examples view on GitHub view source


getNamedColors

getNamedColors( ) → Map

return a map of the named colors.

Returns:

a map of the named colors.

search for examples view on GitHub view source


getRicePaperColor

getRicePaperColor( ) → Color

return standard color for slightly masking background.

Returns:

java.awt.Color

search for examples view on GitHub view source


nameForColor

nameForColor( java.awt.Color color ) → String

return the preferred name for the color

Parameters

color -

Returns:

the preferred name (or #RGB) for the color

search for examples view on GitHub view source