Constructor and Description |
---|
Palette(int size)
Creates a new palette
|
Modifier and Type | Method and Description |
---|---|
boolean |
addColor(byte red,
byte green,
byte blue)
Adds a color to the PCX's palette.
|
Color |
getColor(byte index)
Returns the color of a color within the PCX's palette.
|
boolean |
makeTransparent(int index)
Makes a certain color in the palette transparent.
|
void |
setColor(int index,
Color color)
Changes the color that was at position index in the palette to
a new color, color.
|
String |
toString() |
public Palette(int size)
size
- The number of colors in the palette.public boolean addColor(byte red, byte green, byte blue)
red
- - The red value of the new color (unsigned byte).green
- - The green value of the new color (unsigned byte).blue
- - The blue value of the new color (unsigned byte).public boolean makeTransparent(int index)
index
- - The color that is to become transparent.public void setColor(int index, Color color)
index
- - The index in the palette of the color to be replaced.color
- - The new color.public Color getColor(byte index)
index
- - The index within the palette (unsigned byte).Copyright © 2020. All rights reserved.