Computer Science Canada Quick question. How to change color? |
Author: | xHoly-Divinity [ Mon Sep 12, 2005 5:56 pm ] | ||
Post subject: | Quick question. How to change color? | ||
where the command "c.fillOval (200, 200, 100, 100);" how would I change the colour from being black to say white/green/blue/red/yellow? |
Author: | Cervantes [ Mon Sep 12, 2005 6:15 pm ] | ||||
Post subject: | |||||
If I remember correctly, you merely have to call the setColor method of the Console, providing it with one arguement:
Standard colours, such as red, are built in objects and you don't have to create a new Color object. If you want to use a specific colour with your own specific RGB values, you must create a new Color object:
|
Author: | xHoly-Divinity [ Mon Sep 12, 2005 6:18 pm ] |
Post subject: | |
Thank You! |
Author: | 1of42 [ Mon Sep 12, 2005 10:01 pm ] |
Post subject: | |
For the record, the built-in colors are all static members of the Color class, such as: Color.RED, Color.BLACK, Color.BLUE etc. |