Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 1.03 KB

File metadata and controls

15 lines (10 loc) · 1.03 KB

CanvasGradient

Namespace: SpawnDev.SpawnJS.JSObjects
Inherits: SpawnJSObject
Source: JSObjects/CanvasGradient.cs
MDN Reference: CanvasGradient on MDN

The CanvasGradient interface represents an opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient(), CanvasRenderingContext2D.createConicGradient() or CanvasRenderingContext2D.createRadialGradient(). https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient

Methods

Method Return Type Description
AddColorStop(double offset, string color) void The CanvasGradient.addColorStop() method of the Canvas 2D API adds a new color stop, defined by an offset and a color, to a given canvas gradient. A number between 0 and 1, inclusive, representing the position of the color stop. 0 represents the start of the gradient and 1 represents the end. A CSS <color> value representing the color of the stop.