processing / processing/p5.js

Add Gradients for Fill and Strokes

Open
#7,313 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area:Color Area:Core Discussion Feature Request Help Wanted Technical Initiative
Dominant language
JavaScript
Stars
24k
Forks
3.8k
Avg merge
3d 16h
Merged PRs (30d)
25

Description

Increasing access

This would make many more things possible in p5.js without incurring the heavy performance cost of writing to a texture manually from the CPU or drawing a gradient using strokes, and without requiring the burden of shifting to WebGL and using shaders to achieve the gradient effect.

Most appropriate sub-area of p5.js?
  • Accessibility
  • Color
  • Core/Environment/Rendering
  • Data
  • DOM
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Build process
  • Unit testing
  • Internationalization
  • Friendly errors
  • Other (specify if possible)
Feature request details

Add the ability to use gradients instead of pure colors as a default option using canvas gradients for P2D/HTMLCanvas and WebGL vertex color interpolation for WebGL mode.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the P2D/HTMLCanvas and WebGL rendering paths described in the request, along with how fill and stroke colors are currently handled. Define the API and behavior for gradients in both modes, then verify that gradients work for fills and strokes without requiring manual textures or custom shaders.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.