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

feat(color-picker): add support for alpha channel (deprecates hideChannels, hideHex, hideSaved) #2841

Merged
merged 95 commits into from
May 3, 2023

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Aug 17, 2021

Related Issue: #749

Summary

This brings opacity support to the color picker along with some design updates.

alphaChannel = true + allowEmpty = true

color-picker-redesign-alpha-no-color

alphaChannel = true + allowEmpty = false

color-picker-redesign-alpha

alphaChannel = false + allowEmpty = true

color-picker-redesign-no-color

alphaChannel = false + allowEmpty = false

color-picker-redesign

New props

  • alphaChannel – turns on support for alpha
  • channelsDisabled – replaces hideChannels
  • hexDisabled – replaces hideHex
  • savedDisabled – replaces hideSaved

Changes to existing props

  • format – now supports hexa, rgba-css, hsla-css, rgba, hsla, and hsva
  • hideHex – deprecated
  • hideChannels – deprecated
  • hideSaved – deprecated

Note: Tests will be tackled by #6840

@jcfranco jcfranco added the enhancement Issues tied to a new feature or request. label Aug 17, 2021
@jcfranco jcfranco added this to the Sprint 8/16 – 8/27 milestone Aug 17, 2021
@jcfranco jcfranco self-assigned this Aug 17, 2021
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Aug 25, 2021
@jcfranco jcfranco removed the Stale Issues or pull requests that have not had recent activity. label Aug 27, 2021
@jcfranco jcfranco marked this pull request as ready for review August 27, 2021 21:11
@jcfranco jcfranco requested a review from a team as a code owner August 27, 2021 21:11
@jcfranco
Copy link
Member Author

I'll be adding tests, but probably won't be done soon. In the meantime, I'd appreciate feedback on the current changes. 👀

@jcfranco jcfranco requested review from bstifle and driskull August 27, 2021 21:11
Copy link
Member

@driskull driskull left a 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.

@macandcheese
Copy link
Contributor

macandcheese commented Sep 1, 2021

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:

Screen Shot 2021-09-01 at 9 44 34 AM

Screen Shot 2021-09-01 at 9 48 31 AM

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?

Screen Shot 2021-09-01 at 9 52 31 AM

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.

Screen Shot 2021-09-01 at 9 53 07 AM

Is it expected that hide-hex and allow-alpha does NOT show the slider to adjust opacity?

Spacing bug when only saved items are visible (with hide-hex and hide-channels and NOT allowing opacity):

Screen Shot 2021-09-01 at 9 59 53 AM

@jcfranco jcfranco mentioned this pull request Sep 1, 2021
1 task
@julio8a julio8a requested review from macandcheese and removed request for bstifle September 7, 2021 21:12
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Sep 15, 2021
@github-actions
Copy link
Contributor

This PR has been automatically closed due to inactivity.

@github-actions github-actions bot closed this Sep 18, 2021
@github-actions github-actions bot deleted the jcfranco/749-add-support-for-alpha branch September 18, 2021 01:47
@jcfranco jcfranco restored the jcfranco/749-add-support-for-alpha branch April 8, 2022 02:24
@jcfranco jcfranco reopened this Apr 8, 2022
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 2, 2023
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 2, 2023
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 2, 2023
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels May 3, 2023
@jcfranco jcfranco merged commit 83c5808 into master May 3, 2023
@jcfranco jcfranco deleted the jcfranco/749-add-support-for-alpha branch May 3, 2023 02:55
@github-actions github-actions bot added this to the 2023 May Priorities milestone May 3, 2023
jcfranco added a commit that referenced this pull request May 24, 2023
…d near/past the edge (#7009)

**Related Issue:** #7004

## Summary

Restores the fix from
#4734, which got
unintentionally removed in #2841.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Issues tied to a new feature or request. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants