Color change

This commit is contained in:
aelga 2025-05-16 11:46:33 +02:00
parent 4b05c6bdc7
commit 139ae2c07d
1 changed files with 5 additions and 5 deletions

View File

@ -80,7 +80,7 @@ public class JPanelChessBoard extends JPanel {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
this.setBackground(Color.blue);
this.setBackground(new Color(135,86,59));
if(pieceSelectorMode) {
g.drawImage(
spriteSheet,
@ -97,16 +97,16 @@ public class JPanelChessBoard extends JPanel {
float cellWidth = cellWidth();
float cellHeight = cellHeight();
g.setColor(Color.white);
g.setColor(new Color(214,196,153));
for(int x=0; x<myGame.getWidth();x++) {
for (int y=0; y<myGame.getHeight(); y++) {
boolean isSelect = myGame.isSelected(x,y);
boolean isHighlight = myGame.isHighlighted(x,y);
if(isSelect) {
g.setColor(Color.green);
g.setColor(new Color(240,233,212));
}
if(isHighlight) {
g.setColor(Color.yellow);
g.setColor(new Color(180,100,81));
}
if((x+y)%2==1 || isSelect || isHighlight) {
g.fillRect(
@ -117,7 +117,7 @@ public class JPanelChessBoard extends JPanel {
);
}
if(isHighlight || isSelect) {
g.setColor(Color.white);
g.setColor(new Color(214,196,153));
}
}