Interface CanvasGradient

All Superinterfaces:
org.teavm.jso.JSObject

public interface CanvasGradient extends org.teavm.jso.JSObject
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addColorStop(double offset, String color)
    The CanvasGradient.addColorStop() method adds a new stop, defined by an offset and a color, to the gradient.

    Methods inherited from interface org.teavm.jso.JSObject

    cast
  • Method Details

    • addColorStop

      void addColorStop(double offset, String color)

      The CanvasGradient.addColorStop() method adds a new stop, defined by an offset and a color, to the gradient. If the offset is not between 0 and 1, an INDEX_SIZE_ERR is raised, if the color can't be parsed as a CSS color, a SYNTAX_ERR is raised.

      Parameters:
      offset - Offset between 0 and 1
      color - A CSS parseable color.