Class RadialGradient

  • All Implemented Interfaces:
    Serializable, OptionDataListener, org.zkoss.json.JSONAware

    public class RadialGradient
    extends Optionable
    A radial gradient is a smooth transition from one color to another. In addition, several color transitions can be applied to the same element.

    All the options in this class support DynamicalAttribute.

    Author:
    jumperchen, RaymondChao
    See Also:
    Serialized Form
    • Constructor Detail

      • RadialGradient

        public RadialGradient​(double cx,
                              double cy,
                              double r)
        The cx, cy and r attributes define the outermost circle
    • Method Detail

      • addStop

        public void addStop​(double index,
                            String color)
        Adds the color range for a gradient can be composed of two or more colors. Each color is specified with a offset in order.
      • setStops

        public void setStops​(String color1,
                             String color2)
        Sets the color range for a gradient can be composed of two colors. It is the same as
        
         setStops(Arrays.asList(new Stop(0, color1), new Stop(1, color2)));
         
        See Also:
        setStops(Stop... stops)
      • setStops

        public void setStops​(List<Stop> stops)
        Sets the color range for a gradient can be composed of two or more colors. Each color is specified with a offset in order.

        For example,

        
         setStops(Arrays.asList(new Stop[]{
             new Stop(0, "rgb(255, 255, 255)"),
             new Stop(1, "rgb(200, 200, 255)")
         }));
         
      • setStops

        public void setStops​(Stop... stops)
        Sets the color range for a gradient can be composed of two or more colors. Each color is specified with a offset in order.

        For example,

        
         setStops(
             new Stop(0, "rgb(255, 255, 255)"),
             new Stop(1, "rgb(200, 200, 255)")
         );
         
      • getStops

        public List<Stop> getStops()
        Returns the all stops