Class Gradient


  • public final class Gradient
    extends CanvasObject
    A gradient is an image consisting of a progressive transition between two or more colors.
    Could be Linear or Radial.
    Can be created using the size of CANVAS or CHART area.
    The orientation to have a progressive transition, is defined by an enumeration in order to creates the gradient using the right coordinates and dimension, based on existing items (canvas and chart).
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • getType

        public GradientType getType()
        Returns the gradient type.
        Returns:
        the gradient type
      • getOrientation

        public GradientOrientation getOrientation()
        Returns the gradient orientation.
        Returns:
        the gradient orientation
      • getScope

        public GradientScope getScope()
        Returns the gradient scope.
        Returns:
        the gradient scope
      • getColors

        public List<GradientColor> getColors()
        Returns the unmodifiable list of stopping colors.
        Returns:
        the unmodifiable list of stopping colors.
      • getInterpolatedColorByOffset

        public IsColor getInterpolatedColorByOffset​(double offset)
        Returns a color using the gradient as source of colors.
        Parameters:
        offset - offset to search in the gradient colors
        Returns:
        a color based on offset.