Class GradientColor

    • Method Detail

      • addColorStop

        public void addColorStop​(double d,
                                 SolidColor color)
        Adds a color stop to the gradient
        Parameters:
        d - The relative point of the color stop, between 0 and 1
        color - The color at the point defined by d
      • createLinear

        public static GradientColor createLinear​(double startX,
                                                 double startY,
                                                 double endX,
                                                 double endY)
        Creates a new linear gradient between two given points. Use addColorStop(double, SolidColor) to define the colors.
        Parameters:
        startX - The relative start point on the X-axis, 0..1
        startY - The relative start point on the Y-axis, 0..1
        endX - The relative end point on the X-axis, 0..1
        endY - The relative end point on the Y-axis, 0..1
        Returns:
        A new linear gradient color
      • createRadial

        public static GradientColor createRadial​(double centerX,
                                                 double centerY,
                                                 double radius)
        Creates a radial gradient color at a specified point with the given radius. Use addColorStop(double, SolidColor) to define the colors.
        Parameters:
        centerX - The X coordinate of the center
        centerY - The Y coordinate of the center
        radius - The radius
        Returns:
        A new radial gradient