Intent to Prototype: CSS Color 4 for Canvas Gradients

64 views
Skip to first unread message

Aaron Krajeski

unread,
Feb 20, 2025, 10:51:02 AMFeb 20
to blink-dev, Fernando Serboncini
Contact emails: aar...@chromium.org

Explainer: https://github.com/whatwg/html/issues/7947
Specification: https://github.com/whatwg/html/pull/10986 (draft)

Summary

CSS Color 4 (https://www.w3.org/TR/css-color-4/) added two concepts to CSS gradients: 1. Color interpolation space: how the values in between color stops will be calculated. 2. Hue interpolation method: which direction around the color wheel should be used for the "hue" component of polar color spaces. We are working to add these features to CanvasGradients, along with a premultiplyAlpha boolean.



Blink component: Blink>Canvas

Motivation

CSS Color 4 gradients can easily be made available to canvases and would greatly improve the range, flexibility and usability of canvas gradients.  


Initial public proposal: None

TAG review: None

Risks


Interoperability and Compatibility

None



Gecko: No signal

WebKit: https://github.com/whatwg/html/issues/7947 (@weinig is a webkit contributor)

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Is this feature fully tested by web-platform-testsTests are being added here: https://chromium-review.googlesource.com/c/chromium/src/+/6226021

Flag name on about://flags: CanvasGradientCSSColor4 (will be bundled with experimental web platform features)

Finch feature name: None

Non-finch justification: Canvas gradients and CSS gradients use the same shaders in Skia, this is only an API change and has no foreseeable underlying performance implications.

Requires code in //chrome? False

Estimated milestones

No milestones specified



Link to entry on the Chrome Platform Status: https://chromestatus.com/feature/5168382242193408?gate=6277560230739968

This intent message was generated by Chrome Platform Status.
Reply all
Reply to author
Forward
0 new messages