CHAPTER 7

image

Playing with Colors

In this chapter, you will learn:

  • How colors are represented in JavaFX
  • What different color patterns are
  • How to use image pattern
  • How to use linear color gradient
  • How to use radial color gradient

Understanding Colors

In JavaFX, you can specify color for text and background color for regions. You can specify a color as a uniform color, an image pattern, or a color gradient. A uniform color uses the same color to fill the entire region. An image pattern lets you fill a region with an image pattern. A color gradient defines a color pattern in which the color varies along a straight line from one color to another. The ...

Get Learn JavaFX 8: Building User Experience and Interfaces with Java 8 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.