Class SimplePalette
java.lang.Object
org.apache.commons.imaging.palette.SimplePalette
- All Implemented Interfaces:
Palette
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getEntry
(int index) Gets the color for a given palette index.int
getPaletteIndex
(int rgb) Gets the palette index for a given color.int
length()
Gets the number of entries in the palette.
-
Constructor Details
-
SimplePalette
Constructs a new instance.- Parameters:
palette
- palette to copy and store.
-
-
Method Details
-
getEntry
Description copied from interface:Palette
Gets the color for a given palette index. -
getPaletteIndex
Description copied from interface:Palette
Gets the palette index for a given color.- Specified by:
getPaletteIndex
in interfacePalette
- Parameters:
rgb
- the color to look up- Returns:
- the palette index
-
length
Description copied from interface:Palette
Gets the number of entries in the palette.
-