This applet shows a black button that starts to change colors with time when the users mouse moves over it. When the user clicks on the button with the left mouse button, the applet takes a snapshot of the time-varying color. When the user moves the mouse away from the button, its color returns to black.
For a short tutorial on this sample click this button: