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

Palette-based color picker #6028

Merged
merged 9 commits into from
Jan 27, 2021
Merged

Palette-based color picker #6028

merged 9 commits into from
Jan 27, 2021

Conversation

jamieparkinson
Copy link
Contributor

This is an (arguably) improved UI for colour filtering based on the design in Zeplin.

The library we're using doesn't export the plumbing that we want so I replicated it (ish) which makes the UI much better suited to our needs (and doesn't cause CSS import problems).

It looks like this:
image

const isTouch = (e: InteractionEvent): e is TouchEvent => 'touches' in e;
const clamp = (x: number, min = 0, max = 1) =>
x > max ? max : x < min ? min : x;
const useIsomorphicLayoutEvent =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't see where this is going to be useful? useLayoutEffect is only ever run on the client?

Unless the check is doing something that isn't that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I wonder if we could just use useLayoutEffect though. Happy for either.

Copy link
Contributor

@jamesgorrie jamesgorrie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loving this - I also like that this could easily be implemented sans-JS.

@jamieparkinson jamieparkinson merged commit a6d54e7 into master Jan 27, 2021
@jamieparkinson jamieparkinson deleted the palette-picker branch January 27, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants