-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(color-picker): add support for alpha channel (deprecates hideChannels
, hideHex
, hideSaved
)
#2841
Conversation
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I'll be adding tests, but probably won't be done soon. In the meantime, I'd appreciate feedback on the current changes. 👀 |
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.
Comments. Code looks good but had questions on API naming/consistency. Just some minor cleanup of comments as well.
src/components/calcite-color-picker/calcite-color-picker.e2e.ts
Outdated
Show resolved
Hide resolved
Looks good overall. Here's some quick feedback (sorry in advance) Is appending the alpha value to HEX expected to a user? This seems like non-standard behavior compared to how Sketch, Figma, etc., present it (they leave it as a 6 digit HEX). Additionally it causes some weird overlaps: Perhaps for another time, but 'allow-alpha' with 'hide-opacity' again presents maybe an unexpected visual: Why can I adjust alpha here with HEX, but we don't add an "A" field to rgbA or hslA? Visuals aside, the affordance for setting alpha on hex seems to be to be more approachable with this "lockup" - I assume the majority of color picker end users will just be familiar with 6 digit hex codes and educating them on potential 8 digit hex codes seems like.. maybe not an educational endeavor we need to take. Is it expected that Spacing bug when only saved items are visible (with |
This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This PR has been automatically closed due to inactivity. |
Related Issue: #749
Summary
This brings opacity support to the color picker along with some design updates.
alphaChannel = true
+allowEmpty = true
alphaChannel = true
+allowEmpty = false
alphaChannel = false
+allowEmpty = true
alphaChannel = false
+allowEmpty = false
New props
alphaChannel
– turns on support for alphachannelsDisabled
– replaceshideChannels
hexDisabled
– replaceshideHex
savedDisabled
– replaceshideSaved
Changes to existing props
format
– now supportshexa
,rgba-css
,hsla-css
,rgba
,hsla
, andhsva
hideHex
– deprecatedhideChannels
– deprecatedhideSaved
– deprecatedNote: Tests will be tackled by #6840