The <paint> JavaFX CSS data type represents a texture that is used to paint the background and borders of text and region objects in the scene. The <paint> data type is one of the most widely used and versatile data types in JavaFX CSS. It has several concrete sub-types, which can be defined to create a <paint> object:

Syntax

/*  Defining a font fill with a <color> sub-type */
-fx-text-fill: #81c483;

/*  Defining a background color with a <linear-gradient> sub-type*/
-fx-background-color: linear-gradient(to bottom right, #9cecfb, #65c7f7, #0052d4);

/*  Defining a border color using a <image-pattern>  */
-fx-border-width: 15px;
-fx-border-color: image-pattern('ImagePattern.png', 0%, 0%, 100%, 100%, false);

Values

The JavaFX CSS interpreter isn’t a fully-compliant CSS Interpreter, nor does it support all CSS-values you might expect for the related CSS property.

<paint> can have the following values:

SubtypeDescription
<color>A color defined using a keyword, CSS look-up, RBG, HSB or hexidecimal format
<linear-gradient>Linear gradient generated using the linear-gradient() function
<radial-gradient>Radial gradient generated using the radial-gradient() function
<image-pattern>An image pattern generated using the image-pattern() or repeating-image-pattern() functions

See Also