1 / 4

Color (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;. Color (2). Each color is represented by three primitive colors

branxton
Télécharger la présentation

Color (1)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

More Related