Package org.bukkit.map

# Class MapPalette

java.lang.Object
org.bukkit.map.MapPalette

public final class MapPalette extends Object
Represents the palette that map items use.

These fields are hee base color ranges. Each entry corresponds to four colors of varying shades with values entry to entry + 3.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final byte`
`BLUE`
Deprecated.
Magic value
`static final byte`
`BROWN`
Deprecated.
Magic value
`static final byte`
`DARK_BROWN`
Deprecated.
Magic value
`static final byte`
`DARK_GRAY`
Deprecated.
Magic value
`static final byte`
`DARK_GREEN`
Deprecated.
Magic value
`static final byte`
`GRAY_1`
Deprecated.
Magic value
`static final byte`
`GRAY_2`
Deprecated.
Magic value
`static final byte`
`LIGHT_BROWN`
Deprecated.
Magic value
`static final byte`
`LIGHT_GRAY`
Deprecated.
Magic value
`static final byte`
`LIGHT_GREEN`
Deprecated.
Magic value
`static final byte`
`PALE_BLUE`
Deprecated.
Magic value
`static final byte`
`RED`
Deprecated.
Magic value
`static final byte`
`TRANSPARENT`
Deprecated.
Magic value
`static final byte`
`WHITE`
Deprecated.
Magic value

## Method Summary

Modifier and Type
Method
Description
`static @NotNull Color`
`getColor(byte index)`
Deprecated.
Magic value
`static @org.jetbrains.annotations.NotNull byte[]`
`imageToBytes(@NotNull Image image)`
Deprecated.
Magic value
`static byte`
`matchColor(int r, int g, int b)`
Deprecated.
Magic value
`static byte`
`matchColor(@NotNull Color color)`
Deprecated.
Magic value
`static @NotNull BufferedImage`
`resizeImage(@Nullable Image image)`
Resize an image to 128x128.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### TRANSPARENT

@Deprecated public static final byte TRANSPARENT
Deprecated.
Magic value

See Also:
  - Constant Field Values

### LIGHT_GREEN

@Deprecated public static final byte LIGHT_GREEN
Deprecated.
Magic value

See Also:
  - Constant Field Values

### LIGHT_BROWN

@Deprecated public static final byte LIGHT_BROWN
Deprecated.
Magic value

See Also:
  - Constant Field Values

### GRAY_1

@Deprecated public static final byte GRAY_1
Deprecated.
Magic value

See Also:
  - Constant Field Values

### RED

@Deprecated public static final byte RED
Deprecated.
Magic value

See Also:
  - Constant Field Values

### PALE_BLUE

@Deprecated public static final byte PALE_BLUE
Deprecated.
Magic value

See Also:
  - Constant Field Values

### GRAY_2

@Deprecated public static final byte GRAY_2
Deprecated.
Magic value

See Also:
  - Constant Field Values

### DARK_GREEN

@Deprecated public static final byte DARK_GREEN
Deprecated.
Magic value

See Also:
  - Constant Field Values

### WHITE

@Deprecated public static final byte WHITE
Deprecated.
Magic value

See Also:
  - Constant Field Values

### LIGHT_GRAY

@Deprecated public static final byte LIGHT_GRAY
Deprecated.
Magic value

See Also:
  - Constant Field Values

### BROWN

@Deprecated public static final byte BROWN
Deprecated.
Magic value

See Also:
  - Constant Field Values

### DARK_GRAY

@Deprecated public static final byte DARK_GRAY
Deprecated.
Magic value

See Also:
  - Constant Field Values

### BLUE

@Deprecated public static final byte BLUE
Deprecated.
Magic value

See Also:
  - Constant Field Values

### DARK_BROWN

@Deprecated public static final byte DARK_BROWN
Deprecated.
Magic value

See Also:
  - Constant Field Values

## Method Details

### resizeImage

@NotNull public static @NotNull BufferedImage resizeImage(@Nullable @Nullable Image image)
Resize an image to 128x128.

Parameters:
  `image` - The image to resize.
Returns:
  The resized image.

### imageToBytes

@Deprecated @NotNull public static @org.jetbrains.annotations.NotNull byte[] imageToBytes(@NotNull @NotNull Image image)
Deprecated.
Magic value
Convert an Image to a byte[] using the palette.

Parameters:
  `image` - The image to convert.
Returns:
  A byte[] containing the pixels of the image.

### matchColor

@Deprecated public static byte matchColor(int r, int g, int b)
Deprecated.
Magic value
Get the index of the closest matching color in the palette to the given color.

Parameters:
  `r` - The red component of the color.
  `b` - The blue component of the color.
  `g` - The green component of the color.
Returns:
  The index in the palette.

### matchColor

@Deprecated public static byte matchColor(@NotNull @NotNull Color color)
Deprecated.
Magic value
Get the 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.

### getColor

@Deprecated @NotNull public static @NotNull Color getColor(byte index)
Deprecated.
Magic value
Get the value of the given color in the palette.

Parameters:
  `index` - The index in the palette.
Returns:
  The Color of the palette entry.