This topic has not yet been rated - Rate this topic

addColorStop method

Adds the specified colors and the position in a CanvasGradient object.

HTML Canvas 2D Context, Section 5Internet Explorer 9

Syntax


HRESULT retVal = object.addColorStop(offset, color);

Parameters

offset [in]

Type: float

A floating point value between 0.0 and 1.0 that represents the position between the start and end points in a gradient.

color [in]

Type: string

A CSS color string to display at the position that the offset parameter specifies.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

Remarks

You can call the ICanvasGradient::addColorStop method multiple times to change a gradient. If you never call this method for CanvasGradient, the gradient is not visible. You need to create at least one color stop to have a visible gradient.

See also

Reference
ICanvasRenderingContext2D::createRadialGradient
ICanvasRenderingContext2D::createLinearGradient

 

 

Build date: 11/12/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.