Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: LinearGradient

[15:7] extends: FxObj

Wraps JavaFX LinearGradient, a paint that transitions colors along a straight line defined by two points and a series of color stops. The gradient can use proportional (0.0 to 1.0) or absolute pixel coordinates, and a cycle method controls what happens beyond the defined endpoints. It can be used with GraphicsContext setFill() and setStroke() in place of a solid Color.

Methods

  • LinearGradient (double StartX, double StartY, double EndX, double EndY, bool Proportional, string CycleMethod, list Stops)

    Creates a new linear gradient.

    • @p StartX is a double with the start X coordinate.
    • @p StartY is a double with the start Y coordinate.
    • @p EndX is a double with the end X coordinate.
    • @p EndY is a double with the end Y coordinate.
    • @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.