## org.das2.graph.ColorUtil

single place to contain Color-Name mapping. See https://sourceforge.net/p/autoplot/feature-requests/263/

## ColorUtil( )

## decodeColor

decodeColor( String s ) → java.awt.Color

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

- "red"
- "RED"
- "0xFF0000"
- "0xff0000"
- "#ffeedd"

This also allows a color name to follow the RGB like so:

- "0xFFFF00 (Purple)"

to improve legibility of .vap files.

### Parameters

s - a String

### Returns:

a java.awt.Color
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## encodeColor

encodeColor( java.awt.Color color ) → String

return either a named color or "#" + Integer.toHexString( color.getRGB() & 0xFFFFFF)

### Parameters

color - a Color

### Returns:

named color or hex string like "#FF0000" for Red.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getNamedColors

getNamedColors( ) → java.util.Map

return a map of the named colors.

### Returns:

a map of the named colors.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## getRicePaperColor

getRicePaperColor( ) → java.awt.Color

return standard color for slightly masking background.

### Returns:

a java.awt.Color
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## nameForColor

nameForColor( java.awt.Color color ) → String

return the preferred name for the color

### Parameters

color - a Color

### Returns:

the preferred name (or #RGB) for the color
[search for examples] [view on GitHub] [view on old javadoc] [view source]