Class Palette

java.lang.Object
noaa.coastwatch.render.Palette

public class Palette extends Object
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 Details

    • Palette

      public Palette(String name, IndexColorModel model)
      Constructs a new palette from the specified parameters.
      Parameters:
      name - the color palette name.
      model - the color palette model.
  • Method Details

    • getName

      public String getName()
      Gets the palette name.
    • getModel

      public IndexColorModel getModel()
      Gets the palette model data.
    • remap

      public Palette remap(int length)
      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

      public void add(Color[] colors)
      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

      public void add(Color color)
      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

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object