O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Color Models

Color models translate pixel values into their red, green, blue, and alpha constituents, as presented in evidenced by Table 4-1, which lists the methods from the abstract java.awt.image.ColorModel class (minus the 2D Api methods introduced in the 1.2 JDK).

Table 4-1. java.awt.image.ColorModel Methods (2D Api Methods Omitted)
Method Implementation or Intent
static ColorModel getRGBdefault() Returns the default RGB color model
abstract int getAlpha(int) Returns the color's alpha component
abstract int getBlue(int) Returns the color's blue component
abstract int getGreen(int) Returns the color's green component
abstract int getRed(int) Returns the color's red component
int getRGB(int) Returns the color of the pixel in RGB format
int ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required