-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Enhance <input type=color> with alpha and colorspace=display-p3 #10456
base: main
Are you sure you want to change the base?
Conversation
a48f1e6
to
1ea2ca0
Compare
@domenic observed that for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Editorially looking pretty good, although some questions in #3400 (comment) seem interesting as an uninformed-about-color person.
I think it would take us some time to upgrade the color picker popup in chromium (thanks @lukewarlow for mentioning that DevTools has a better one), but if we can just support serialization etc. in IDLs based on these new attributes in the meantime based on WPTs then that sounds good to me. |
I think it would be unfortunate to support the alpha attribute but not actually allow the user to select an alpha value? But not fully supporting picking display P3 but supporting the serialisation seems like it could be more acceptable? |
Yeah I suppose we could easily and quickly add alpha, then hopefully follow up with display p3 later |
3c211f0
to
4da70fc
Compare
The new alpha and colorspace attributes give it parity with the 2D canvas API. As part of this change we do away with the "simple color" concept as that has been replaced by CSS colors now. Fixes #3400.
4da70fc
to
327b2ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall
<span data-x="named color">named colors</span>, then return the <span>simple color</span> | ||
corresponding to that keyword. <ref>CSSCOLOR</ref></p> | ||
<p>If <var>input</var> is an <span>ASCII case-insensitive</span> match for one of the <span | ||
data-x="named color">named colors</span>, then return the CSS color corresponding to that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest "CSS color" link to https://drafts.csswg.org/css-color-5/#typedef-color
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that matches how we talk about "CSS color" in HTML. What we mean here is the parsed representation, the internal object if you will, not the syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay. Perhaps the <color> type from CSS Typed OM, then?
Having read through the spec one bit still feels slightly ambiguous to me, but this could just be that I'm missing something. It seems that Is there an obvious reason in the spec that it uses https://drafts.csswg.org/css-color/#serializing-color-function-values instead? |
The new alpha and colorspace attributes give it parity with the 2D canvas API.
As part of this change we do away with the "simple color" concept as that has been replaced by CSS colors now.
Fixes #3400.
WebKit can contribute tests as part of implementing this feature.
It would be great to get some help from @svgeesus @tabatkins and @LeaVerou on resolving #8917 so HTML can clearly link a way to serialize CSS color values (for the Hexadecimal state we can continue to maintain that ourselves). I think we have a plan there, but let me know if there's anything still unclear (prolly best in that issue).(See WHATWG Working Mode: Changes for more details.)
/common-microsyntaxes.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/input.html ( diff )
/rendering.html ( diff )