Interface MapPalette.MapColorCache

Enclosing class:
MapPalette

public static interface MapPalette.MapColorCache
Holds cached information for matching map colors of a given RBG color.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if the MapColorCache has values cached, if not it will return false.
    byte
    Get the cached index of the closest matching color in the palette to the given color.
  • Method Details

    • isCached

      boolean isCached()
      Returns true if the MapColorCache has values cached, if not it will return false. A case where it might return false is when the cache is not build jet.
      Returns:
      true if this MapColorCache has values cached otherwise false
    • matchColor

      @Internal byte matchColor(@NotNull @NotNull Color color)
      Get the cached index of the closest matching color in the palette to the given color.
      Parameters:
      color - The Color to match.
      Returns:
      The index in the palette.
      Throws:
      IllegalStateException - if isCached() returns false
      API Note:
      Internal Use Only