Package ilda

Class IldaPalette

java.lang.Object
be.cmbsoft.ilda.IldaPalette

public class IldaPalette extends Object
A Palette is a collection of colours. Points in a format 0 or 1 file have an index referring to a colour in a palette. Changing a palette results in changing the colours of a frame.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addColour (int r, int g, int b)
     
    int
    getColour (int index)
    Colors are stored as 32-bit integers, first eight bits are not used, next eight bits are red, following eight bits are green and last eight bits are blue
    byte[]
    Converts the palette to bytes which can be added in front of an ilda file or stored separately
    void
    Converts this palette to the standard 64 color palette used in most programs

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • IldaPalette

      public IldaPalette()
  • Method Details

    • addColour

      public void addColour (int r, int g, int b)
    • getColour

      public int getColour (int index)
      Colors are stored as 32-bit integers, first eight bits are not used, next eight bits are red, following eight bits are green and last eight bits are blue
      Parameters:
      index - number referring to the palette
      Returns:
      the color in the aforementioned format
    • paletteToBytes

      public byte[] paletteToBytes()
      Converts the palette to bytes which can be added in front of an ilda file or stored separately
      Returns:
      array of bytes with ilda-compliant palette
    • setDefaultPalette

      public void setDefaultPalette()
      Converts this palette to the standard 64 color palette used in most programs