Presentation is loading. Please wait.

Presentation is loading. Please wait.

Color (1) Turtle class contains a method to change the pen color Note: before using Color class, you should add following line in the top of the source.

Similar presentations


Presentation on theme: "Color (1) Turtle class contains a method to change the pen color Note: before using Color class, you should add following line in the top of the source."— Presentation transcript:

1 Color (1) Turtle class contains a method to change the pen color Note: before using Color class, you should add following line in the top of the source file to import Color class import java.awt.Color;

2 Color (2) Each color is represented by three primitive colors –Red, Green, Blue (RGB color specification) –A color (what you see) changes based on the value of each primitive color –Each color will contain a value between 0~255

3 Color (3)

4 Color (4) In Java, you can create a color object Color c1 = new Color( 50, 255, 100 ); setPenColor( c1 ); Or you can simply write setPenColor( new Color( 50, 255, 100 ) ); Note: Please look at this site http://www.jafar.com/java/csel/index.html


Download ppt "Color (1) Turtle class contains a method to change the pen color Note: before using Color class, you should add following line in the top of the source."

Similar presentations


Ads by Google