Bukkit  1.4.7-R1.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
 The base color ranges.
 
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.

Definition at line 11 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.

Definition at line 146 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.

Definition at line 89 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.

Definition at line 113 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.

Definition at line 123 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 75 of file MapPalette.java.

Member Data Documentation

final byte org.bukkit.map.MapPalette.BLUE = 48
static

Definition at line 66 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.BROWN = 40
static

Definition at line 64 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.DARK_BROWN = 52
static

Definition at line 67 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.DARK_GRAY = 44
static

Definition at line 65 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.DARK_GREEN = 28
static

Definition at line 61 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.GRAY_1 = 12
static

Definition at line 57 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.GRAY_2 = 24
static

Definition at line 60 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.LIGHT_BROWN = 8
static

Definition at line 56 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.LIGHT_GRAY = 36
static

Definition at line 63 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.LIGHT_GREEN = 4
static

Definition at line 55 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.PALE_BLUE = 20
static

Definition at line 59 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.RED = 16
static

Definition at line 58 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.TRANSPARENT = 0
static

The base color ranges.

Each entry corresponds to four colors of varying shades with values entry to entry + 3.

Definition at line 54 of file MapPalette.java.

final byte org.bukkit.map.MapPalette.WHITE = 32
static

Definition at line 62 of file MapPalette.java.


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