Interface IMapColors


public interface IMapColors
This is used to convert 24-bit RGB color space to the minecraft map color space.
  • Field Details

  • Method Details

    • color

      byte color(int r, int g, int b)
      Returns:
      the minecraft map color nearest of the given red, green and blue colors.
    • color

      byte color(Color color)
      Returns:
      the minecraft map color nearest of the given color.
    • color

      byte color(int rgb)
      Returns:
      the minecraft map color nearest of the given RGB color.
    • colors

      default byte[] colors(int[] rgb)
      See Also:
    • colors

      byte[] colors(int[] rgb, int threads)
      Converts the given RGB colors to the minecraft map color space.
      The number of threads can be specified to speed up the process.

      Tests show that the most efficient number of threads for converting colors is 3: Graph
      If the number of used threads is not important, use colors(int[]) instead.

      Returns:
      the minecraft map colors
    • convertDirect

      default ColorBuffer convertDirect(FullSpacedColorBuffer buffer)
      Returns:
      a minecraft map color buffer converted from the specified RGB color buffer
    • adjustColors

      FullSpacedColorBuffer adjustColors(FullSpacedColorBuffer buffer, Converter converter)
      Creates a copy and adjusts the colors of the full spaced color buffer to minecraft map colors.
      Parameters:
      buffer - the buffer to adjust
      converter - the converter to use
      Returns:
      the copied buffer with the adjusted colors
    • convertImage

      byte[] convertImage(BufferedImage image)
      Returns:
      the minecraft map colors converted from the specified image.
    • toColor

      Color toColor(byte color)
      Returns:
      the RGB color associated with the specified minecraft map color
    • toRGB

      int toRGB(byte color)
      Returns:
      the RGB color associated with the specified minecraft map color
    • toRGBs

      int[] toRGBs(byte[] colors)
      Returns:
      the RGB colors associated with the specified minecraft map colors