Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeform gradients #2303

Open
Keavon opened this issue Feb 18, 2025 · 0 comments
Open

Freeform gradients #2303

Keavon opened this issue Feb 18, 2025 · 0 comments
Labels
Graphics GPU and graphics programming related

Comments

@Keavon
Copy link
Member

Keavon commented Feb 18, 2025

Similar to #2302, we need to find a clever way to generate these within the SVG or SVG + CSS spec. Rasterization is probably the most likely approach here. But here are some ideas:

  • Raserization.
  • A point cloud of circles with radial gradients interpolating over alpha, with optional transforms to essentially create 2D Gaussian splats.
  • For use cases supporting CSS as part of SVG, we can render quads with linear gradients applied to each edge which generates a quad of a mesh, then the CSS perspective transform would skew the four corners to fit within the mesh adjacent to other quads doing the same thing to build a mesh representing the full freeform gradient.

There are two possible sources of color spread, which can be mixed:

  • Point (with a color and radius)

    Image

  • Path (with a color interpolated along the path, such as being set at each anchor)

    Image

@Keavon Keavon added the Graphics GPU and graphics programming related label Feb 18, 2025
@github-project-automation github-project-automation bot moved this to Short-Term in Task Board Feb 18, 2025
@Keavon Keavon moved this from Short-Term to Medium-Term in Task Board Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graphics GPU and graphics programming related
Projects
Status: Medium-Term
Development

No branches or pull requests

1 participant