Skip to content
Snippets Groups Projects

Added colouring of pixels

Merged Edvard Granheim Harbo requested to merge pixelColour into dev
5 files
+ 44
26
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -80,9 +80,7 @@ public class ChaosCanvas{
@@ -80,9 +80,7 @@ public class ChaosCanvas{
int x = (int) indices.getX0();
int x = (int) indices.getX0();
int y = (int) indices.getX1();
int y = (int) indices.getX1();
if (x >= 0 && x < width && y >= 0 && y < height) {
if (x >= 0 && x < width && y >= 0 && y < height) {
if (canvas[x][y] != 1) { // Check if the pixel is not already set
canvas[x][y] += 1;
canvas[x][y] = 1;
}
} else {
} else {
System.out.println("Indices out of bounds");
System.out.println("Indices out of bounds");
}
}
Loading