Interface Palette

All Known Implementing Classes:
MedianCutPalette, QuantizedPalette, SimplePalette

public interface Palette
Color palette.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    getEntry(int index)
    Looks up the color for a given palette index.
    int
    getPaletteIndex(int rgb)
    Looks up the palette index for a given color.
    int
    The number of entries in the palette.
  • Method Details

    • getPaletteIndex

      int getPaletteIndex(int rgb) throws ImageWriteException
      Looks up the palette index for a given color.
      Parameters:
      rgb - the color to look up
      Returns:
      the palette index
      Throws:
      ImageWriteException - if it fails to read the palette index
    • getEntry

      int getEntry(int index)
      Looks up the color for a given palette index.
      Parameters:
      index - the palette index to look up
      Returns:
      the color in ARGB format
    • length

      int length()
      The number of entries in the palette.
      Returns:
      the number of palette entries