Section 13.3 Color Control
• Class Color (p. 559) declares methods and constants for manipulating colors in a Java program.
• Every color is created from a red, a green and a blue component. Together these components are called RGB values (p. 560). The RGB components specify the amount of red, green and blue in a color, respectively. The larger the value, the greater the amount of that particular color.
• Color methods getRed, getGreen and getBlue (p. 560) return int values from 0 to 255 representing the amount of red, green and blue, respectively.
• Graphics method getColor (p. 560) returns a Color object with the current drawing color.
• Graphics method setColor (p. 560) sets the current drawing color.
• Graphics method fillRect (p. 560) draws ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access