question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ColorPicker Color property doesn't work

See original GitHub issue

Describe the bug When modifying the Color property manually, the color of the ColorPicker doesn’t change However, when modifying the HsvColor property, the color changes correctly

I found in the xml that the ColorPicker uses the HsvColor property to draw its Background. This property should automatically change when the Color property changes, but this is not happening because the ignorePropertyChanged is set to true for the ColorPicker

To Reproduce Create a ColorPicker and change its Color

ColorPicker colorPicker = new ColorPicker();
colorPicker.Color = new Color(255, 255, 0, 0);

Expected behavior The color of the ColorPicker (and the ColorView popup) should change

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • Version 11.0-preview1

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
timuniecommented, Oct 4, 2022

Thanks for the background you gave. Makes sense to me. But you may be right about the lifecycle thing.

0reactions
robloocommented, Oct 15, 2022

I have a fix for this that is the lesser of two evils. It will be included with #9140.

What it does is switch the main processing from the ColorView hosted in the control template to the ColorPicker itself. This works-around lifetime limitations with how the control is created (and the template applied, I got lazy trying to make the control as simple as possible and overlooked this). As a side-effect, a new property for IsHostedInColorPicker is added – that’s the lesser of two evils. I normally don’t like properties like this but the alternative was to attempt to pass control back-and-forth between the ColorPicker and ColorView based on when the template is applied. That is potentially error-prone and is likely difficult to maintain.

Also see the discussion here: https://github.com/AvaloniaUI/Avalonia/discussions/9128

Read more comments on GitHub >

github_iconTop Results From Across the Web

colorpicker can't set value to property
It's okay but when I change color and submit the changed values does not comes to post controller. in post usViewModel.UsColor; comes null....
Read more >
"Keep going with Apps" Color Picker ERROR
The issue is that the colorpicker does not run in the preview pane, only in the app. If you are using Playground on...
Read more >
Color picker color selector doesn't work in IE11
Hello, I have recently implemented the Color Picker in my site and I'm having issues in IE 11. The color picker opens, however,...
Read more >
TextStim won't appear when I use the color picker
I tried to use the color picker for a visual. ... values in the code match the values in the property menu, save...
Read more >
<input type="color"> - HTML: HyperText Markup Language
Here we establish some variables, setting up a variable that contains the color we'll set the color picker to when we first load...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found