Skip to content

PaletteFactory

sirrandalot edited this page Mar 12, 2018 · 2 revisions

PaletteFactory contains static classes for creating Palettes.


Methods:

static Palette createPalette(int [] colours)

  • Creates a Palette using an integer array of colours.

static Palette createPalette(PalettePredef p)

  • Creates a pre-defined Palette using a PalettePredef enum value.

static Palette getPaletteFromImage(BufferedImage img, int numColours)

  • Returns a Palette based on a BufferedImage and the number of colours to use.
  • Each pixel in the image, read from (0, 0) counts for one colour in the palette.