Class GradientColor


  • public final class GradientColor
    extends NativeObjectContainer
    Contains the color and its offset to set a gradient.
    Author:
    Andrea "Stock" Stocchero
    • Field Detail

      • DEFAULT_OFFSET_START

        public static final double DEFAULT_OFFSET_START
        Offset 0 defined as default start.
        See Also:
        Constant Field Values
      • DEFAULT_OFFSET_STOP

        public static final double DEFAULT_OFFSET_STOP
        Offset 1 defined as default stop.
        See Also:
        Constant Field Values
    • Constructor Detail

      • GradientColor

        public GradientColor​(double offset,
                             IsColor color)
        Creates a stopping gradient with its offset.
        Parameters:
        offset - offset of color
        color - color instance
      • GradientColor

        public GradientColor​(double offset,
                             String color)
        Creates a stopping gradient with its offset.
        Parameters:
        offset - offset of color
        color - color instance
    • Method Detail

      • getOffset

        public double getOffset()
        Returns the defined offset for stopping gradient color.
        Returns:
        the defined offset for stopping gradient color.
      • getColorAsString

        public String getColorAsString()
        Returns the color of the gradient.
        Returns:
        the color of the gradient.
      • getColor

        public IsColor getColor()
        Returns the color of the gradient.
        Returns:
        the color of the gradient.
      • checkOffsetWithinBounds

        public static void checkOffsetWithinBounds​(double offset)
        Any double between 0.0d and 1.0d (inclusive) is valid.
        Parameters:
        offset - value between 0 and 1 for where the color stop is located.