Download presentation
Presentation is loading. Please wait.
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.