Class ColorMap

java.lang.Object
dev.cerus.maps.api.colormap.ColorMap

public class ColorMap extends Object
A container for map colors
  • Constructor Details

    • ColorMap

      public ColorMap()
  • Method Details

    • putColor

      public void putColor(ColorMap.Color color)
    • fromId

      public ColorMap.Color fromId(int id)
      Find color by id
      Parameters:
      id - Map color id
      Returns:
      Color or null
    • getById

      public ColorMap.Color getById(int id)
      Find color by id
      Parameters:
      id - Map color id
      Returns:
      Color or null
    • mapColorToRgb

      public Color mapColorToRgb(byte color)
      Find java color by id
      Parameters:
      color - Map color id
      Returns:
      Java color or java color id 0 (or null)
    • rgbToMapColor

      public ColorMap.Color rgbToMapColor(int r, int g, int b)
      Find color by RGB
      Parameters:
      r - Red
      g - Green
      b - Blue
      Returns:
      Color or transparent color (0) (or null)
    • getColors

      public ColorMap.Color[] getColors()