prepare for some colors - greyed background
- background is not greyed depending on surrouding walls - MazeColorMap to prepare for color edition
This commit is contained in:
@@ -73,6 +73,23 @@ public class MazeCellParameters {
|
||||
offsetY + (int) (mapHeight * height));
|
||||
}
|
||||
|
||||
public Color getGreyedColor(Color color, int greylevel)
|
||||
{
|
||||
Color greyedColor = new Color(
|
||||
Math.max(0,color.getRed() - greylevel),
|
||||
Math.max(0,color.getGreen() - greylevel),
|
||||
Math.max(0,color.getBlue() - greylevel));
|
||||
return greyedColor;
|
||||
}
|
||||
public void drawBackground(Graphics g, int pX, int pY, short walls) {
|
||||
int x = offsetX + (int) (pX * width);
|
||||
int y = offsetY + (int) (pY * height);
|
||||
Color savecolor = g.getColor();
|
||||
int greylevel = walls << 2;
|
||||
g.setColor(getGreyedColor(savecolor,greylevel));
|
||||
//g.fillRect(x+1,y+1,((int)width) -1,((int)height) - 1);
|
||||
g.fillRect(x,y,((int)width),((int)height));
|
||||
}
|
||||
public void drawWalls(Graphics g, int pX, int pY, short walls) {
|
||||
int x = offsetX + (int) (pX * width);
|
||||
int y = offsetY + (int) (pY * height);
|
||||
|
||||
Reference in New Issue
Block a user