public void fillRect(int xPos, int yPos, int width, int height, int color) {
		if (xPos > this.width)
			xPos = this.width;
		if (yPos > this.height)
			yPos = this.height;
		if (xPos + width > this.width)
			width = this.width - xPos;
		if (yPos + height > this.height)
			height = this.height - yPos;
		for (int y = yPos; y < yPos + height; y++) {
			for (int x = xPos; x < xPos + width; x++) {
				pixels[x + y * this.width] = color;
			}
		}
	}