Automattic / Automattic/node-canvas

Support createConicGradient

Open
#2,422 0 comments 1 reaction 0 assignees View on GitHub
Feature
Dominant language
JavaScript
Stars
10.7k
Forks
1.2k
Avg merge
4d 8h
Merged PRs (30d)
1

Description

## Issue or Feature
- [ ] If this is an issue with installation, I have read the [troubleshooting guide](https://github.com/Automattic/node-canvas/issues/1511).

## Steps to Reproduce

```js
var Canvas = require('canvas');
var canvas = Canvas.createCanvas(200, 200);
var ctx = canvas.getContext('2d');

ctx.createConicGradent(...)
```

This is relatively new in canvas - https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createConicGradient

Apparently Cairo supports this via mesh gradients - https://lea.verou.me/blog/2015/06/conical-gradients-today/

> Another reason was that [Cairo](http://cairographics.org/), the graphics library used in Chrome and Firefox had no way of drawing a conical gradient. However, this changed a while ago, when [they supported mesh gradients](http://libregraphicsworld.org/blog/entry/mesh-gradients-in-cairo-now-official), of which conical gradients are a mere special case.

## Your Environment
* Version of node-canvas (output of `npm list canvas` or `yarn list canvas`):
* Environment (e.g. node 20.9.0 on macOS 14.1.1):

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.