Welcome to the CSC Q&A.
Get help and give help!
Write great code!
It is our choices... that show what we truly are, far more than our abilities.


+15 votes
asked in CSC211_Winter2018 by (8 points)

1 Answer

+9 votes

To create your own colors: Color = new Color(, , ); where the red/green/blue components should be integers values between 0 and 255. The higher the value, the more of that color is mixed in. So maybe Color purple = new Color(191, 66, 244); You can Google a RGB color picker to find the red, green, blue values for a color or just experiment.

Then with the Graphics object from a DrawingPanel (let's say it's called g), you can set the color for drawing using g.setColor(purple);

answered by (8 points)