Package noaa.coastwatch.render
Class Palette
java.lang.Object
noaa.coastwatch.render.Palette
The
Palette
allows the user to associate a name and
index color model together as a palette and perform manipulations
on the palette colors.- Since:
- 3.1.1
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionPalette
(String name, IndexColorModel model) Constructs a new palette from the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a single color to the end of the palette.void
Adds a number of colors to the end of the palette.boolean
Indicates whether some other object is "equal to" this one.getModel()
Gets the palette model data.getName()
Gets the palette name.remap
(int length) Remaps a color palette to a new number of colors.
-
Constructor Details
-
Palette
Constructs a new palette from the specified parameters.- Parameters:
name
- the color palette name.model
- the color palette model.
-
-
Method Details
-
getName
Gets the palette name. -
getModel
Gets the palette model data. -
remap
Remaps a color palette to a new number of colors.- Parameters:
length
- the size of the new palette.- Returns:
- a new palette of the specified size.
-
add
Adds a number of colors to the end of the palette. The palette may be extended up to the maximum of 256 colors.- Parameters:
colors
- an array of color objects to add.
-
add
Adds a single color to the end of the palette. The palette may be extended up to the maximum of 256 colors.- Parameters:
color
- the color to add.- See Also:
-
equals
Indicates whether some other object is "equal to" this one.
-