Bukkit  1.7.9-R0.2-63-gcb87f4e
 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 233 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 167 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 194 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 207 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 151 of file MapPalette.java.

Member Data Documentation

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

Definition at line 138 of file MapPalette.java.

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

Definition at line 128 of file MapPalette.java.

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

Definition at line 143 of file MapPalette.java.

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

Definition at line 133 of file MapPalette.java.

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

Definition at line 113 of file MapPalette.java.

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

Definition at line 93 of file MapPalette.java.

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

Definition at line 108 of file MapPalette.java.

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

Definition at line 88 of file MapPalette.java.

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

Definition at line 123 of file MapPalette.java.

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

Definition at line 83 of file MapPalette.java.

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

Definition at line 103 of file MapPalette.java.

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

Definition at line 98 of file MapPalette.java.

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

Definition at line 78 of file MapPalette.java.

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

Definition at line 118 of file MapPalette.java.


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