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

ColorEdit4 defualt hex input defaults alpha to 00 #3973

Closed
squadack opened this issue Mar 26, 2021 · 1 comment
Closed

ColorEdit4 defualt hex input defaults alpha to 00 #3973

squadack opened this issue Mar 26, 2021 · 1 comment

Comments

@squadack
Copy link

Version/Branch of Dear ImGui:

Version: 1.78
Branch: master

My Issue/Question:

Currently, when using input field in ColorEdit4() to type/paste hexadecimal color and the number will be too short (i.e. will not include alpha value), tha alpha value will default to 0. In my opinion defaulting to FF would be better in case someone pastes a color without alpha channel to make this color visible.

One possible solution could be to replace line

i[0] = i[1] = i[2] = i[3] = 0;

with

i[0] = i[1] = i[2] = 0;
i[3] = 255;

Screenshots/Video

Before loosing focus:
image
After loosing focus:
image

Standalone, minimal, complete and verifiable example:
N/A

@ocornut
Copy link
Owner

ocornut commented Mar 26, 2021

That's a good idea! I have no applied this change. Thank you!

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