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

if Color=Color.Black ColorPickerDialog doesn't work correctly #38

Open
Charltsing opened this issue Mar 14, 2022 · 2 comments
Open

if Color=Color.Black ColorPickerDialog doesn't work correctly #38

Charltsing opened this issue Mar 14, 2022 · 2 comments

Comments

@Charltsing
Copy link

 ColorPickerDialogDemoForm.cs  --->  BrowseColorButton_Click
 Color = Color.FromArgb(255, 0, 0, 0)

ColorPickerDialog doesn't work correctly。

 HslColor hc = new HslColor(Color.FromArgb(255, 0, 0, 0));
 if (hc.L == 0) hc.L = 0.5;   
 Color color = hc.ToRgbColor();

ColorPickerDialog works fine.

ColorPickerDialog does not support Color.Black?

@cyotek
Copy link
Owner

cyotek commented Mar 14, 2022

I'm not entirely sure what you're reporting - when you say it doesn't work correctly, what do you mean?

The following observations apply to the version 2, currently in beta. If you're using a different version let me know.

In the ColorPickerDialog, changing a colour via the wheel no longer resets the Lightness value as it used to, instead it keeps the current value. As black has a lightness of zero, that means when using the wheel all colours will appear as black, until you change the lightness slider anyway. It works in reverse too, I'd already seen it when using pure white.

As your second example changes the lightness from 0 to 0.5, this is retained by the wheel for the colours it creates.

While I know the behaviour is confusing I haven't thought of a better way to resolve it yet, or even if it needs resolving - I have seen other colour pickers behave the same way.

@Charltsing
Copy link
Author

changing a colour via the wheel no longer resets the Lightness value as it used to, instead it keeps the current value.

Can I customize this behavior? reset or no reset Lightness value

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

2 participants