Skip to content

@ralphschuler.webgl shader factory.<internal>.CanvasGradient

github-actions edited this page Nov 26, 2023 · 1 revision

Interface: CanvasGradient

@ralphschuler/webgl-shader-factory.<internal>.CanvasGradient

An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient().

MDN Reference

Table of contents

Methods

Methods

addColorStop

addColorStop(offset, color): void

Adds a color stop with the given color to the gradient at the given offset. 0.0 is the offset at one end of the gradient, 1.0 is the offset at the other end.

Throws an "IndexSizeError" DOMException if the offset is out of range. Throws a "SyntaxError" DOMException if the color cannot be parsed.

MDN Reference

Parameters

Name Type
offset number
color string

Returns

void

Defined in

node_modules/typescript/lib/lib.dom.d.ts:5360

Typescript Libraries

Modules

Namespaces

Clone this wiki locally