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

[Color Area] wrong Color Handle color when only providing x and y attributes to Color Area #2688

Closed
spdev3000 opened this issue Oct 26, 2022 · 3 comments · Fixed by #4240
Closed
Assignees
Labels
bug Something isn't working Component: Color Area

Comments

@spdev3000
Copy link
Collaborator

spdev3000 commented Oct 26, 2022

Expected Behaviour

When providing x and y attributes to the sp-color-area the handle position changes and internal color will be updated - thus reflecting in the different color-handle color

Actual Behaviour

When providing x and y attributes to the sp-color-area handle position changes but internal color won't be updated

Reproduce Scenario (including but not limited to)

open https://studio.webcomponents.dev/edit/OhmxNozsXaiZ9O4F0aPW
compare start color of both Color Areas

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

This might be solvable by simple adding:

this.colorController.applyColorFromState()

in set x() and set y()

Logs taken while reproducing problem

@Westbrook
Copy link
Contributor

Interesting. I wouldn't say that you supposed to use the x and y properties directly, but we're clearly not doing anything to prevent you from doing so...

If you think this one liner corrects this, happy to accept a PR on this! Would that be enough to remove the need to the downstream work you are doing in your project?

Separately, and likely longer term, we are looking at https://colorjs.io/ as a replacement for TinyColor, which looks to have higher quality/fidelity color transforms, and hopefully aligns more closely with a future browser standard in color management in JS. Not sure if that effect this request in any way, but wanted to keep you up to date.

@Westbrook
Copy link
Contributor

Making some progress on the alternative approach that should give us better fidelity to the color spaces we use today as well as open up a whole load of new color spaces that we haven't previous leveraged. This specific issue is hopefully shown as fixed in https://color-js--spectrum-web-components.netlify.app/storybook/?path=/story/color-area--applied-vales, lots of work on insuring a smooth transition between the two versions, but progress.

@Westbrook
Copy link
Contributor

Fixed by #4240

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Component: Color Area
Projects
None yet
5 participants