Skip to content

Issue adjusting value of ColorPicker object through callback #159

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

Closed
TCherici opened this issue Oct 18, 2021 · 3 comments
Closed

Issue adjusting value of ColorPicker object through callback #159

TCherici opened this issue Oct 18, 2021 · 3 comments

Comments

@TCherici
Copy link

TCherici commented Oct 18, 2021

When trying to set the rgb values of a ColorPicker object through a callback in python, the result is always off.

For example, if I try to set its value to {'rgb': {'r': 255, 'g': 242, 'b': 229, 'a': 1}}, it gets assigned the following values instead:
image

The g and b values are swapped, and the r value is set to 1. No clue why that happens.

I haven't yet fully figured out the cause of the issue, but I reckon it has something to do with the ColorPicker javascript object having its color attribute being (erroneously?) named rbg instead of rgb.

@ryanvolpi
Copy link

I can confirm, I am having similar difficulties. See also the example in the dash plotly documentation. The color picker is given parameter value=dict(rgb=dict(r=255, g=0, b=0, a=0) but the resulting color selection is RGBA(0,0,0,1).

image

Karan-S-Mittal added a commit to Karan-S-Mittal/dash-daq that referenced this issue Oct 23, 2021
@Karan-S-Mittal
Copy link
Contributor

here's a preview of the change

Screen.Recording.2021-10-23.at.8.39.59.PM.mov

.

@TCherici
Copy link
Author

Thanks for fixing!

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

No branches or pull requests

3 participants