O'Reilly logo

Platinum Edition Using XHTML™, XML, and Java™ 2 by Andrew H. Watt, Mike Morgan, Jim O'Donnell, Eric Ladd

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

Displaying Colors

Remember when you were in elementary school and the teacher showed you how to make green by combining yellow and blue paint? Forget all that—those techniques applied to pigments on paper, in which colors are made by subtracting colors from the white light falling on the paper. Most of the graphics you make in Java must look good on a computer screen—an additive process based on the primary colors red, green, and blue. Common combinations are

  • Red and green, which results in yellow when the colors are bright and in brown when the colors are less intense

  • Green and blue, resulting in cyan

  • Red and blue, resulting in magenta

Black is formed by the absence of all light, and white is formed by the combination of all the additive primary ...

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