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

ColorPickers interferences #6155

Closed
fmauclere opened this issue Feb 10, 2023 · 2 comments
Closed

ColorPickers interferences #6155

fmauclere opened this issue Feb 10, 2023 · 2 comments

Comments

@fmauclere
Copy link

First of all, thank you @ocornut for your fantastic work.

I found a bug on ColorPickers (both RGB and RGBA versions).

With ImGui v1.89.2, when I do this :

static float aaa[4] = { 0, 0, 0, 0 };
static float bbb[4] = { 0, 0, 0, 0 };

if (ImGui::Begin("window aaa"))
  ImGui::ColorPicker4("aaa", aaa);
ImGui::End();

if (ImGui::Begin("window bbb"))
  ImGui::ColorPicker4("bbb", bbb);
ImGui::End();

The ColorPickers seem to interfere with each other when their RGB values are the same full black or full white (all 0 or all 255).
If I use the vertical color bar on the right side of aaa, then the aspect of bbb will also change.

@ocornut
Copy link
Owner

ocornut commented Feb 11, 2023

Thank you for reporting. We have code trying to preserve HSV properties for lossy round-trips via encoded u32 value and it seems it has a problem here.

@ocornut
Copy link
Owner

ocornut commented Feb 14, 2023

Pushed fix fa0852f
Thank you for reporting !

@ocornut ocornut closed this as completed Feb 14, 2023
ocornut added a commit that referenced this issue Feb 14, 2023
…interfering with the displayed value (but not stored value) of others widgets instances. (#6155)

Amend 30546bc, accb026, 38d22bc
kjblanchard pushed a commit to kjblanchard/imgui that referenced this issue May 5, 2023
…interfering with the displayed value (but not stored value) of others widgets instances. (ocornut#6155)

Amend 30546bc, accb026, 38d22bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants