Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+15 votes
asked in CSC211_Winter2018 by (1 point)

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 (1 point)
...