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
ConstructorsConstructorDescriptionPalette(String name, IndexColorModel model) Constructs a new palette from the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a single color to the end of the palette.voidAdds a number of colors to the end of the palette.booleanIndicates 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.
-