Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: RadialGradient

[15:7] extends: FxObj

Wraps JavaFX RadialGradient, a paint that radiates colors outward from a center focal point through a series of color stops. The focal point can be offset from the center using a focus angle and distance, and coordinates may be proportional or absolute. A cycle method controls how the gradient repeats beyond the defined radius. It can be used with GraphicsContext setFill() and setStroke() in place of a solid Color.

Methods

  • RadialGradient (double FocusAngle, double FocusDistance, double CenterX, double CenterY, double Radius, bool Proportional, string CycleMethod, list Stops)

    Creates a new radial gradient.

    • @p FocusAngle is a double with the angle of the focus point in degrees.
    • @p FocusDistance is a double with the distance of the focus point from the center (0.0 to 1.0).
    • @p CenterX is a double with the center X coordinate.
    • @p CenterY is a double with the center Y coordinate.
    • @p Radius is a double with the radius of the gradient.
    • @p Proportional is a bool. When true, coordinates are proportional (0.0 to 1.0). When false, they are absolute.
    • @p CycleMethod is a string with the cycle method: NO_CYCLE, REFLECT, or REPEAT.
    • @p Stops is a list of Stop objects defining the gradient colors.
  • getFocusAngle ()

    Returns the focus angle of the gradient in degrees.

    • @r A double with the focus angle.
  • getFocusDistance ()

    Returns the distance of the focus point from the center, between 0.0 and 1.0 of the radius.

    • @r A double with the focus distance.
  • getCenterX ()

    Returns the X coordinate of the gradient center.

    • @r A double with the center X.
  • getCenterY ()

    Returns the Y coordinate of the gradient center.

    • @r A double with the center Y.
  • getRadius ()

    Returns the radius of the gradient.

    • @r A double with the radius.
  • isProportional ()

    Returns whether the gradient coordinates are proportional (0.0 to 1.0) rather than absolute pixel values.

    • @r A bool with true when proportional.
  • getCycleMethod ()

    Returns the cycle method enum value used when the gradient is sampled outside the defined radius.

    • @r An AJO holding the javafx.scene.paint.CycleMethod enum value.
  • getStops ()

    Returns the list of color Stop entries that define the gradient.

    • @r A List AJO of Stop elements.
  • isOpaque ()

    Returns whether the gradient is fully opaque (every stop color has an alpha of 1.0).

    • @r A bool with true when the gradient is opaque.