Skip to content

Support linearGradient/radialGradient when using fillStyle #247

@Holybasil

Description

@Holybasil

Currently, we can only pass solid colors, but it would be great to have the ability to apply gradient colors directly to paths when transforming them on the canvas.

const gradient = ctx.createLinearGradient(x1, y1, x2, y2);
gradient.addColorStop(0, 'red');
gradient.addColorStop(1, 'blue');

ctx.fillStyle = gradient;

At present, #80 (comment) works for me.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions