Bukkit  1.6.4-R2.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.map.MapPalette Class Reference

Represents the palette that map items use. More...

Static Public Member Functions

static BufferedImage resizeImage (Image image)
 Resize an image to 128x128.
 
static byte[] imageToBytes (Image image)
 Convert an Image to a byte[] using the palette.
 
static byte matchColor (int r, int g, int b)
 Get the index of the closest matching color in the palette to the given color.
 
static byte matchColor (Color color)
 Get the index of the closest matching color in the palette to the given color.
 
static Color getColor (byte index)
 Get the value of the given color in the palette.
 

Static Public Attributes

static final byte TRANSPARENT = 0
 
static final byte LIGHT_GREEN = 4
 
static final byte LIGHT_BROWN = 8
 
static final byte GRAY_1 = 12
 
static final byte RED = 16
 
static final byte PALE_BLUE = 20
 
static final byte GRAY_2 = 24
 
static final byte DARK_GREEN = 28
 
static final byte WHITE = 32
 
static final byte LIGHT_GRAY = 36
 
static final byte BROWN = 40
 
static final byte DARK_GRAY = 44
 
static final byte BLUE = 48
 
static final byte DARK_BROWN = 52
 

Detailed Description

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.

Definition at line 14 of file MapPalette.java.

Member Function Documentation

static Color org.bukkit.map.MapPalette.getColor ( byte  index)
static

Get the value of the given color in the palette.

Parameters
indexThe index in the palette.
Returns
The Color of the palette entry.
Deprecated:
Magic value

Definition at line 209 of file MapPalette.java.

static byte [] org.bukkit.map.MapPalette.imageToBytes ( Image  image)
static

Convert an Image to a byte[] using the palette.

Parameters
imageThe image to convert.
Returns
A byte[] containing the pixels of the image.
Deprecated:
Magic value

Definition at line 146 of file MapPalette.java.

References org.bukkit.map.MapPalette.matchColor().

static byte org.bukkit.map.MapPalette.matchColor ( int  r,
int  g,
int  b 
)
static

Get the index of the closest matching color in the palette to the given color.

Parameters
rThe red component of the color.
bThe blue component of the color.
gThe green component of the color.
Returns
The index in the palette.
Deprecated:
Magic value

Definition at line 172 of file MapPalette.java.

Referenced by org.bukkit.map.MapPalette.imageToBytes().

static byte org.bukkit.map.MapPalette.matchColor ( Color  color)
static

Get the index of the closest matching color in the palette to the given color.

Parameters
colorThe Color to match.
Returns
The index in the palette.
Deprecated:
Magic value

Definition at line 184 of file MapPalette.java.

static BufferedImage org.bukkit.map.MapPalette.resizeImage ( Image  image)
static

Resize an image to 128x128.

Parameters
imageThe image to resize.
Returns
The resized image.

Definition at line 130 of file MapPalette.java.

Member Data Documentation

final byte org.bukkit.map.MapPalette.BLUE = 48
static
Deprecated:
Magic value

Definition at line 117 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.BROWN = 40
static
Deprecated:
Magic value

Definition at line 107 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.DARK_BROWN = 52
static
Deprecated:
Magic value

Definition at line 122 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.DARK_GRAY = 44
static
Deprecated:
Magic value

Definition at line 112 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.DARK_GREEN = 28
static
Deprecated:
Magic value

Definition at line 92 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.GRAY_1 = 12
static
Deprecated:
Magic value

Definition at line 72 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.GRAY_2 = 24
static
Deprecated:
Magic value

Definition at line 87 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.LIGHT_BROWN = 8
static
Deprecated:
Magic value

Definition at line 67 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.LIGHT_GRAY = 36
static
Deprecated:
Magic value

Definition at line 102 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.LIGHT_GREEN = 4
static
Deprecated:
Magic value

Definition at line 62 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.PALE_BLUE = 20
static
Deprecated:
Magic value

Definition at line 82 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.RED = 16
static
Deprecated:
Magic value

Definition at line 77 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.TRANSPARENT = 0
static
Deprecated:
Magic value

Definition at line 57 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.WHITE = 32
static
Deprecated:
Magic value

Definition at line 97 of file MapPalette.java.


The documentation for this class was generated from the following file: