Package org.bukkit.map
Class MapPalette
java.lang.Object
org.bukkit.map.MapPalette
public final class MapPalette
extends java.lang.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 byteBLUEDeprecated.Magic valuestatic byteBROWNDeprecated.Magic valuestatic byteDARK_BROWNDeprecated.Magic valuestatic byteDARK_GRAYDeprecated.Magic valuestatic byteDARK_GREENDeprecated.Magic valuestatic byteGRAY_1Deprecated.Magic valuestatic byteGRAY_2Deprecated.Magic valuestatic byteLIGHT_BROWNDeprecated.Magic valuestatic byteLIGHT_GRAYDeprecated.Magic valuestatic byteLIGHT_GREENDeprecated.Magic valuestatic bytePALE_BLUEDeprecated.Magic valuestatic byteREDDeprecated.Magic valuestatic byteTRANSPARENTDeprecated.Magic valuestatic byteWHITEDeprecated.Magic value -
Method Summary
Modifier and Type Method Description static java.awt.ColorgetColor(byte index)Deprecated.Magic valuestatic byte[]imageToBytes(java.awt.Image image)Deprecated.Magic valuestatic bytematchColor(int r, int g, int b)Deprecated.Magic valuestatic bytematchColor(java.awt.Color color)Deprecated.Magic valuestatic java.awt.image.BufferedImageresizeImage(java.awt.Image image)Resize an image to 128x128.
-
Field Details
-
TRANSPARENT
@Deprecated public static final byte TRANSPARENTDeprecated.Magic value- See Also:
- Constant Field Values
-
LIGHT_GREEN
@Deprecated public static final byte LIGHT_GREENDeprecated.Magic value- See Also:
- Constant Field Values
-
LIGHT_BROWN
@Deprecated public static final byte LIGHT_BROWNDeprecated.Magic value- See Also:
- Constant Field Values
-
GRAY_1
@Deprecated public static final byte GRAY_1Deprecated.Magic value- See Also:
- Constant Field Values
-
RED
@Deprecated public static final byte REDDeprecated.Magic value- See Also:
- Constant Field Values
-
PALE_BLUE
@Deprecated public static final byte PALE_BLUEDeprecated.Magic value- See Also:
- Constant Field Values
-
GRAY_2
@Deprecated public static final byte GRAY_2Deprecated.Magic value- See Also:
- Constant Field Values
-
DARK_GREEN
@Deprecated public static final byte DARK_GREENDeprecated.Magic value- See Also:
- Constant Field Values
-
WHITE
@Deprecated public static final byte WHITEDeprecated.Magic value- See Also:
- Constant Field Values
-
LIGHT_GRAY
@Deprecated public static final byte LIGHT_GRAYDeprecated.Magic value- See Also:
- Constant Field Values
-
BROWN
@Deprecated public static final byte BROWNDeprecated.Magic value- See Also:
- Constant Field Values
-
DARK_GRAY
@Deprecated public static final byte DARK_GRAYDeprecated.Magic value- See Also:
- Constant Field Values
-
BLUE
@Deprecated public static final byte BLUEDeprecated.Magic value- See Also:
- Constant Field Values
-
DARK_BROWN
@Deprecated public static final byte DARK_BROWNDeprecated.Magic value- See Also:
- Constant Field Values
-
-
Method Details
-
resizeImage
public static java.awt.image.BufferedImage resizeImage(java.awt.Image image)Resize an image to 128x128.- Parameters:
image- The image to resize.- Returns:
- The resized image.
-
imageToBytes
@Deprecated public static byte[] imageToBytes(java.awt.Image image)Deprecated.Magic valueConvert 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 valueGet 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(java.awt.Color color)Deprecated.Magic valueGet 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 public static java.awt.Color getColor(byte index)Deprecated.Magic valueGet the value of the given color in the palette.- Parameters:
index- The index in the palette.- Returns:
- The Color of the palette entry.
-