-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Array color input for Canvas2D #5616
Comments
In general, the WebKit team feels this is a good direction. A few comments:
|
We had a conversation with the CSS WG and CSS Typed OM is very close to have a Color type. Given that, we are working on modifying this to simply support the Typed OM color type described here: https://drafts.css-houdini.org/css-typed-om-1/#colorvalue-objects |
#6609 too. |
Given
in CSS Typed OM there is no need for this as developers could pass these objects anyway and implementations could optimize the stringification away if they wanted to. The one perhaps annoying edge case would have if someone had overwritten the stringification behavior. Generally we avoid overloading if (default) stringification ends up doing the same thing. (Although to be fair those code paths might have been less hot than this one.) |
You're referring to CSSColorValue objects themselves? From the perspective of Canvas2D style input they definitely don't need to stringify. |
I think you might be missing my point? I'm saying that if they will stringify I see less of a need to accept them directly as in most cases you cannot tell the difference. Implementations could optimize those cases where there is no difference if they wanted to. |
In particular, if they stringify, then the existing setter in spec and implementations will automatically call that stringifier (like it does for every JS object) so there's no need to write spec text to handle it. |
Oh yeah, I definitely missed your point. Thanks for clearing that up. |
Allow RGB and RGBA colors to be specified by a sequence of floats on canvas2D.
Working proposal: https://github.com/fserb/canvas2D/blob/master/spec/array-color-input.md
(cc @whatwg/canvas )
The text was updated successfully, but these errors were encountered: