// ColorGrid.java // TYPE YOUR NAME AND THE DATE import java.awt.Color; /** Represents a color grid, a two-dimensional array of colors. Allows clients to set and modify the colors of individual cells and rectangular areas. */ public class ColorGrid { // DECLARE INSTANCE VARIABLES /** Constructs a 100x100 grid, with all cells set to Color.WHITE. */ public ColorGrid() { // IMPLEMENT } /** Constructs a rows x columns grid, with all cells set to Color.WHITE. @param rows the number of rows. @param columns the number of columns. */ public ColorGrid(int rows, int columns) { // IMPLEMENT } /** Constructs a rows x columns grid, with all cells set to startingColor. @param rows the number of rows. @param columns the number of columns. @param startingColor the starting color for all cells in the grid. */ public ColorGrid(int rows, int columns, Color startingColor) { // IMPLEMENT } /** Gets the number of rows. @return number of rows in the grid. */ public int rows() { // IMPLEMENT } /** Gets the number of columns. @return number of columns in the grid. */ public int columns() { // IMPLEMENT } /** Gets a copy of the color grid as a 2-dimensional array. @return a copy of the color grid. */ public Color[][] grid() { // IMPLEMENT } /** Gets the color at the indicated row and column of the grid. @param row the row of the grid cell to get - range 0 to rows-1 assumed. @param column the column of the grid cell to get. - 0 to columns-1 assumed. */ public Color get(int row, int column) { // IMPLEMENT } /** Sets the color at the indicated row and column of the grid. @param row the row of the grid cell to set - range 0 to rows-1 assumed. @param column the column of the grid cell to set - 0 to columns-1 assumed. @param color the color to which the grid cell is set. */ public void set(int row, int column, Color color) { // IMPLEMENT } /** Sets the color of the indicated rectangle of the grid. @param row1 the first row of the rectangle - range 0 to rows-1 assumed. @param column1 the first column of the rectangle - range 0 to -1 assumed. @param row2 last row of the rectangle - range row1 to rows-1 assumed. @param column2 last column of the rectangle - range column1 to columns-1 assumed. @param color the color to which the grid cell is set. */ public void set(int row1, int column1, int row2, int column2, Color color) { // IMPLEMENT } /** Darkens (makes darker) the color at the indicated row and column of the grid. @param row the row of the grid cell to darken - range 0 to rows-1 assumed. @param column the column of the grid cell to darken - 0 to columns-1 assumed. */ public void darken(int row, int column) { // IMPLEMENT } /** Brightens (makes brighter) the color at the indicated row and column of the grid. @param row the row of the grid cell to brighten - range 0 to rows-1 assumed. @param column the column of the grid cell to brighten - 0 to columns-1 assumed. */ public void brighten(int row, int column) { // IMPLEMENT } /** Darkens the indicated rectangle of the grid. @param row1 the first row of the rectangle - range 0 to rows-1 assumed. @param column1 the first column of the rectangle - range 0 to -1 assumed. @param row2 last row of the rectangle - range row1 to rows-1 assumed. @param column2 last column of the rectangle - range column1 to columns-1 assumed. */ public void darken(int row1, int column1, int row2, int column2) { // IMPLEMENT } /** Brightens the indicated rectangle of the grid. @param row1 the first row of the rectangle - range 0 to rows-1 assumed. @param column1 the first column of the rectangle - range 0 to -1 assumed. @param row2 last row of the rectangle - range row1 to rows-1 assumed. @param column2 last column of the rectangle - range column1 to columns-1 assumed. */ public void brighten(int row1, int column1, int row2, int column2) { // IMPLEMENT } }