files/en-us/web/api/canvasgradient/index.md
{{APIRef("Canvas API")}}{{AvailableInWorkers}}
The CanvasGradient interface represents an opaque object describing a gradient. It is returned by the methods {{domxref("CanvasRenderingContext2D.createLinearGradient()")}}, {{domxref("CanvasRenderingContext2D.createConicGradient()")}} or {{domxref("CanvasRenderingContext2D.createRadialGradient()")}}.
It can be used as a {{domxref("CanvasRenderingContext2D.fillStyle", "fillStyle")}} or {{domxref("CanvasRenderingContext2D.strokeStyle", "strokeStyle")}}.
As an opaque object, there is no exposed property.
offset and a color, to the gradient.{{Specifications}}
{{Compat}}