CPSC 120 Fall 2007
Assignnment 6: Color Gradients
Due Friday, December 7, by 4 pm

Color Gradients

Color Gradients are a visual technique that blend two colors together; transitioning from one color to the another over a fixed space.   The images below show some of the ways that Color Gradients can be used to achieve various visual effects.    A) blends a bold color (blue) with the background color (white).    The effect is that the bottom boundary of the box has faded away, while the top boundary is crisp and well defined.   B) blends two colors to produce an effect that may resemble a sunrise.   C)  The word 'Hot' is reinforced by blending together colors reminiscent of fire.   D)  Blending colors that are slightly brighter and slightly darker than the background can produce a 3D effect.  
Gradient Pictures
For this assignment, you will create a program that allows the user to select colors and blend them together to see their gradient.  

Program Interface

Your program should display color menus at the top and bottom of the window. When the user clicks on a color in either menu a gradient between that color and the one in the other menu should be displayed in the space between the menus. When a different color is clicked on in either menu, the corresponding color in the gradient should change. Each menu should have at least five color buttons. Additionally, there should be a set of text boxes that allow the user to specify a "Custom Color" button.    Remember that the Color class can specify colors in terms of Red, Green and Blue components (so you will need three text boxes as well as the corresponding button).   A demo will be posted on the course web page to give you an idea of what the GUI should look like.

Program Design and Specifications

To complete this program, you will need to create three files: ColorButtonPanel.java, GradientPanel.java, and ColorGradientApp.java

ColorButtonPanel: This class is responsible for creating a menu of Buttons that allows the user to select the color to be used in the gradient.

It will consist of the following instance data:

The following public methods are also needed:

GradientPanel: This class is the main panel where the gradients will be drawn 

The following instance variables are needed.

The GradientPanel class also needs to provide the following public methods:

ColorGradientApp:   Contains the main method of the application - Creates a JFrame that contains a GradientPanel.  

Implementation Strategy

As always, you should divide your work into small, manageable sections.   Implement and test each section before moving on to the next.  A suggested order is as follows:

Grading As usual your program will be graded on both style and correctness

Academic Integrity Reminder: Programming assignments are to be your own work. You may get help on the specifics of the assignment from no one except the instructor. You may not show your program to anyone or look at anyone's program or share ideas with anyone about how to write the program.

What to turn in

Turn in hardcopy of your .java files. Tar up your assign6 directory and e-mail it to your instructor