You want to fill your shapes with simple colors and gradient colors.
In JavaFX, all shapes can be filled with simple colors and gradient colors. The following are the main classes used to fill shape nodes:
The following code uses the preceding classes to add radial and linear gradient colors as well as transparent (alpha channel level) colors to our shapes. We will be using an ellipse, rectangle, and rounded rectangle in our recipe. A solid black line (as depicted in Figure 1-13) also appears in our recipe to demonstrate the transparency of our shape’s color.