|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.monkeycoder.monkeynes.hardware.NesPalette
This class defines the built in 64 color palette of the NES. Only 52 of
those colors are unique. It allows access to predefined colors as both
Java specific Color objects and as raw RGB integer values.
It also supports updating the palette dynamically which the NES does not.
Originally part of the MonkeyNES project.
| Field Summary | |
static int |
PAL_BACKGROUND_ADDRESS
|
static int |
PAL_SPRITE_ADDRESS
|
| Constructor Summary | |
NesPalette()
Creates a new NesPalette and initializes it to the color values a real NES uses. |
|
| Method Summary | |
Color |
getColor(int index)
Returns the color at the requested index. |
int |
getColorRgb(int index)
Returns the color at the requested index as an RGB integer value. |
void |
setColor(int index,
Color value)
Sets a new color value into the palette. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int PAL_BACKGROUND_ADDRESS
public static final int PAL_SPRITE_ADDRESS
| Constructor Detail |
public NesPalette()
| Method Detail |
public Color getColor(int index)
index - The requested index.
public int getColorRgb(int index)
index - The requested index.
public void setColor(int index,
Color value)
index - The index that will get the new color.value - The new color for the specified index.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||