12.3. Color Control
Class Color declares methods and constants for manipulating colors in a Java program. The predeclared color constants are summarized in Fig. 12.3, and several color methods and constructors are summarized in Fig. 12.4. Note that two of the methods in Fig. 12.4 are Graphics methods that are specific to colors.
Color constant | RGB value |
---|---|
public final static Color RED | 255, 0, 0 |
public final static Color GREEN | 0, 255, 0 |
public final static Color BLUE | 0, 0, 255 |
public final static Color ORANGE | 255, 200, 0 |
public final static Color PINK | 255, 175, 175 |
public final static Color CYAN | 0, 255, 255 |
public final static Color MAGENTA | 255, 0, 255 |
public final static Color YELLOW | 255, 255, 0 |
public final static ... |
Get Java™ How to Program, Seventh Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.