Coder Social home page Coder Social logo

colorpicker's Introduction

ColorPicker

Build Status CI

NuGet NuGet MyGet

Github All Releases GitHub Release Github Releases

Download

The latest downloads are available in the release section.

About

ColorPicker is an Avalonia UI Framework color picker control.

Usage

Install-Package ThemeEditor.Controls.ColorPicker

<StyleInclude Source="avares://ThemeEditor.Controls.ColorPicker/ColorPicker.axaml" />
xmlns:cp="clr-namespace:ThemeEditor.Controls.ColorPicker;assembly=ThemeEditor.Controls.ColorPicker"
<cp:ColorPicker Color="Red" />

NuGet

Color picker control is delivered as a NuGet package.

You can find the packages here NuGet and install the package like this:

Install-Package ThemeEditor.Controls.ColorPicker

or by using nightly build feed:

  • Add https://www.myget.org/F/themeeditor-nightly/api/v2 to your package sources
  • Alternative nightly build feed https://pkgs.dev.azure.com/wieslawsoltes/GitHub/_packaging/Nightly/nuget/v3/index.json
  • Update your package using ThemeEditor.Controls.ColorPicker feed

and install the package like this:

Install-Package ThemeEditor.Controls.ColorPicker -Pre

Resources

License

ColorPicker is licensed under the MIT license.

colorpicker's People

Contributors

maxkatz6 avatar wieslawsoltes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

colorpicker's Issues

Popup / Expandable color control

The color control found in some WPF toolkits (e.g. Xceed) is expandable - i.e. you click somewhere and a popup opens allowing you to change the color.

In case you want the same behavior in WPF using the great color picker control provided in this repository, the following snippet may help:

      <Style Selector="local|PopupColorPicker">
        <Style.Resources>
          <local:ColorToBrushConverter x:Key="ColorToBrushConverter"/>
        </Style.Resources>
        <Setter Property="Template">
          <ControlTemplate>
            <StackPanel>
              <ToggleButton Name="PopupButton" Background="Transparent" Width="100" Height="24" DockPanel.Dock="Right" Margin="0, 0, 5, 0">
                <Grid>
                  <Rectangle Width="200" Height="{Binding #PopupButton.Bounds.Height}">
                    <Rectangle.Fill>
                      <VisualBrush TileMode="Tile" SourceRect="0, 0, 16, 16" DestinationRect="0, 0, 16, 16">
                        <VisualBrush.Visual>
                          <Path Data="M 0,0 L 0,8 L 8,8 L 8,0 Z M 8,8 L 8,16 L 16,16 L 16,8 Z" Fill="Gray"></Path>
                        </VisualBrush.Visual>
                      </VisualBrush>
                    </Rectangle.Fill>
                  </Rectangle>
                  <Rectangle Fill="{TemplateBinding Color, Converter={StaticResource ColorToBrushConverter}}" Width="200" Height="200"></Rectangle>
                </Grid>
                <ToggleButton.Styles >
                  <Style Selector="ToggleButton:checked /template/ ContentPresenter, ToggleButton:pressed /template/ ContentPresenter">
                    <Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}"/>
                  </Style>
                  <Style Selector="ToggleButton:checked /template/ ContentPresenter">
                    <Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderHighBrush}"/>
                  </Style>
                </ToggleButton.Styles>
              </ToggleButton>
              <Popup IsOpen="{Binding #PopupButton.IsChecked, Mode=TwoWay}" StaysOpen="False">
                <Border Background="{DynamicResource ThemeBackgroundBrush}" Padding="5" CornerRadius="3" BorderBrush="{DynamicResource ThemeBorderLowBrush}" BorderThickness="1">
                  <cp:ColorPicker Name="ColorPicker" Width="300" Color="{TemplateBinding Color, Mode=TwoWay}"/>
                </Border>
              </Popup>
            </StackPanel>
          </ControlTemplate>
        </Setter>
      </Style>
    public class ColorToBrushConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is Color)
            {
                return new SolidColorBrush((Color)value);
            }
            throw new NotImplementedException();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
    class PopupColorPicker : ColorPicker
    {

    }

which results in the following:

grafik

This could potentially be added to the nuget package.

Double precision error when opening color picker

Hi
I've just downloaded and tried to use the ThemeEditor on a windows 10, net6.0 machine.

As soon as I click on any of the options that bring up the color picker, the application exits.

Upon downloading the source and running the debugger, I found that certain values are failing validation checks.

For example, when I click on the Background Color, the alpha validation immediately fails with an alpha value of 100.00000000000001.

private static bool ValidateAlpha(double alpha)
{
    if (alpha < 0.0 || alpha > 100.0)
    {
        throw new ArgumentException("Invalid Alpha value.");
    }
    return true;
}

Similarly for Foreground Color, where the ValidateValue method raises an exception for value -1.4210854715202004E-14 soon as I click it.

From what I understand, making the double types into a decimal is one way of fixing these floating point errors.
Maybe there's some other way to validate the values or constrain them?

HSL support

Many times, when I interact with colors in various software - I want to use HSL color space to adjust colors. It fits my needs better than HSV, but it most often is ignored by developers and not acknowledged as a necessity.

Lightness and Saturation of HSL are more closely correlated to physical properties I need to adjust (Lightness - can go lighter and darker for any color, Saturation - from "single" wavelength of pure hue to even distribution of gray color) - this allows accurate single-slider adjustments.
HSV, while has simpler math underneath, doesn't have as meaningful sliders and mostly regarded for better color range on 2D palette.

Being implemented in controls like this will hopefully make it available in more applications.

Color picker should be color-error tolerant in release mode

Can't reproduce it sadly, but some users reported crashes when color picker is opening or value changing.
At least I have stack trace:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException: Invalid Value value.
   at ThemeEditor.Controls.ColorPicker.HsvProperties.ValidateValue(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPicker.axaml.cs:line 290
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 102
   at ThemeEditor.Controls.ColorPicker.HsvProperties.UpdatePropertyValues() in /_/src/ThemeEditor.Controls.ColorPicker/ColorPicker.axaml.cs:line 344
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/LightweightObservableBase.cs:line 138
   at Avalonia.Reactive.AvaloniaPropertyObservable`1.PropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e) in /_/src/Avalonia.Base/Reactive/AvaloniaPropertyObservable.cs:line 65
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 763
   at Avalonia.AvaloniaObject.Avalonia.PropertyStore.IValueSink.ValueChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 511
   at Avalonia.ValueStore.NotifyValueChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 367
   at Avalonia.ValueStore.SetExisting[T](Object slot, StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 267
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 102
   at ThemeEditor.Controls.ColorPicker.ColorPicker.UpdateValuesFromThumbs() in /_/src/ThemeEditor.Controls.ColorPicker/ColorPicker.axaml.cs:line 909
   at ThemeEditor.Controls.ColorPicker.ColorPicker.ColorCanvas_PointerMoved(Object sender, PointerEventArgs e) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPicker.axaml.cs:line 988
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) in /_/src/Avalonia.Interactivity/EventRoute.cs:line 152
   at Avalonia.Interactivity.EventRoute.RaiseEvent(IInteractive source, RoutedEventArgs e) in /_/src/Avalonia.Interactivity/EventRoute.cs:line 79
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) in /_/src/Avalonia.Interactivity/Interactive.cs:line 123
   at Avalonia.Input.MouseDevice.MouseMove(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers) in /_/src/Avalonia.Input/MouseDevice.cs:line 268
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e) in /_/src/Avalonia.Input/MouseDevice.cs:line 142
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in /_/src/Avalonia.Input/InputManager.cs:line 37
   at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs:line 487
   at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs:line 33
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 205
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 61
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 132
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 187
   at App.Program.A(String[] )

Dragging Color Selector to Bottom Crashes Application

AvaloniaUI 0.10.15
ColorPicker 0.10.14

I have a color picker declared like this:

<colorPicker:ColorPicker x:Name="main"
                                 Grid.ColumnSpan="2"
                                 Margin="10" 
                                 Color="{Binding CurrentColor, Mode=TwoWay}">
    <colorPicker:ColorPicker.Styles>
        <Style Selector="colorPicker|ColorPicker /template/ colorPicker|ColorPickerValuesPresenter">
            <Setter Property="MinHeight" Value="200" />
            <Setter Property="MinWidth" Value="200" />
            <Setter Property="IsVisible" Value="True" />
        </Style>
        <Style Selector="colorPicker|ColorPicker /template/ colorPicker|ColorPickerPropertiesPresenter#PART_ColorPickerPropertiesPresenter">
            <Setter Property="(DockPanel.Dock)" Value="Right" />
            <Setter Property="IsVisible" Value="False" />
        </Style>
    </colorPicker:ColorPicker.Styles>
</colorPicker:ColorPicker>

Everything is working fine, the two way binding is updating correctly. CurrentColor is of Type Avalonia.Media.Color.

The issue manifests when the color selector is dragged to the extreme bottom edge. Which errors here:

private static bool ValidateValue(double value)
{
    if (value < 0.0 || value > 100.0)
    {
        throw new ArgumentException("Invalid Value value.");
    }
    return true;
}

With the following stack trace.

System.ArgumentException: Invalid Value value.
   at ThemeEditor.Controls.ColorPicker.Props.HsvProperties.ValidateValue(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/Props/HsvProperties.cs:line 54
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 98
   at Avalonia.AvaloniaObject.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 367
   at ThemeEditor.Controls.ColorPicker.Props.HsvProperties.set_Value(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/Props/HsvProperties.cs:line 83
   at ThemeEditor.Controls.ColorPicker.Props.HsvProperties.UpdatePropertyValues() in /_/src/ThemeEditor.Controls.ColorPicker/Props/HsvProperties.cs:line 105
   at ThemeEditor.Controls.ColorPicker.ColorPickerProperties.<OnColorPickerChange>b__12_2(Double _) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerProperties.cs:line 55
   at System.Reactive.AnonymousObserver`1.OnNextCore(T value) in /_/Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs:line 67
   at System.Reactive.ObserverBase`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:line 34
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/LightweightObservableBase.cs:line 139
   at Avalonia.Reactive.AvaloniaPropertyObservable`1.PropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e) in /_/src/Avalonia.Base/Reactive/AvaloniaPropertyObservable.cs:line 67
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 761
   at Avalonia.AvaloniaObject.Avalonia.PropertyStore.IValueSink.ValueChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 531
   at Avalonia.ValueStore.NotifyValueChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 355
   at Avalonia.ValueStore.SetExisting[T](Object slot, StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 284
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 107
   at Avalonia.AvaloniaObject.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 367
   at ThemeEditor.Controls.ColorPicker.ColorPickerValuesPresenter.set_Value3(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerValuesPresenter.cs:line 56
   at ThemeEditor.Controls.ColorPicker.ColorPickerValuesPresenter.UpdateValuesFromThumbs() in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerValuesPresenter.cs:line 220
   at ThemeEditor.Controls.ColorPicker.ColorPickerValuesPresenter.ColorCanvas_PointerMoved(Object sender, PointerEventArgs e) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerValuesPresenter.cs:line 311
   at Avalonia.Interactivity.Interactive.<AddHandler>g__InvokeAdapter|4_0[TEventArgs](Delegate baseHandler, Object sender, RoutedEventArgs args) in /_/src/Avalonia.Interactivity/Interactive.cs:line 62
   at Avalonia.Interactivity.Interactive.<>c__4`1.<AddHandler>b__4_1(Delegate baseHandler, Object sender, RoutedEventArgs args) in /_/src/Avalonia.Interactivity/Interactive.cs:line 68
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e) in /_/src/Avalonia.Interactivity/EventRoute.cs:line 167
   at Avalonia.Interactivity.EventRoute.RaiseEvent(IInteractive source, RoutedEventArgs e) in /_/src/Avalonia.Interactivity/EventRoute.cs:line 101
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e) in /_/src/Avalonia.Interactivity/Interactive.cs:line 122
   at Avalonia.Input.MouseDevice.MouseMove(IMouseDevice device, UInt64 timestamp, IInputRoot root, Point p, PointerPointProperties properties, KeyModifiers inputModifiers, Lazy`1 intermediatePoints) in /_/src/Avalonia.Input/MouseDevice.cs:line 292
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawPointerEventArgs e) in /_/src/Avalonia.Input/MouseDevice.cs:line 182
   at Avalonia.Input.MouseDevice.ProcessRawEvent(RawInputEventArgs e) in /_/src/Avalonia.Input/MouseDevice.cs:line 90
   at Avalonia.Input.InputManager.ProcessInput(RawInputEventArgs e) in /_/src/Avalonia.Input/InputManager.cs:line 35
   at Avalonia.Controls.TopLevel.HandleInput(RawInputEventArgs e) in /_/src/Avalonia.Controls/TopLevel.cs:line 504
   at Avalonia.Win32.WindowImpl.AppWndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.AppWndProc.cs:line 520
   at Avalonia.Win32.WindowImpl.WndProc(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam) in /_/src/Windows/Avalonia.Win32/WindowImpl.WndProc.cs:line 30
   at Avalonia.Win32.Interop.UnmanagedMethods.DispatchMessage(MSG& lpmsg)
   at Avalonia.Win32.Win32Platform.RunLoop(CancellationToken cancellationToken) in /_/src/Windows/Avalonia.Win32/Win32Platform.cs:line 210
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 65
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209

If I have some time later I'll pull the source into my project and see if I can identify the cause.

Reference against stable Avalonia packages

This project is always using the latest Avalonia CI builds, which results in builds failing with Detected package downgrade errors as soon as Avalonia uses a more up to date version of e.g. SkiaSharp.NativeAssets.Linux than this project does:

error NU1605: Detected package downgrade: SkiaSharp.NativeAssets.Linux from 1.68.2 to 1.68.1. Reference the package directly from the project to select a different version.
error NU1605:  ThemeEditor -> Avalonia.Desktop 0.9.999-cibuild0007071-beta -> Avalonia.Skia 0.9.999-cibuild0007071-beta -> SkiaSharp.NativeAssets.Linux (>= 1.68.2)
error NU1605:  ThemeEditor -> SkiaSharp.NativeAssets.Linux (>= 1.68.1)

Could you please consider referencing against stable Avalonia builds to prevent this great tool from breaking over time?

ColorPicker doesnt show / blank

I'm trying to use the ColorPicker but when declared nothing shows.
I'm not sure if it require more code to make it work but i'm calling the control like any other:

<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:cp="clr-namespace:ThemeEditor.Controls.ColorPicker;assembly=ThemeEditor.Controls.ColorPicker"
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="UVtools.WPF.Windows.ColorPickerWindow"
        Title="ColorPickerWindow">
  <cp:ColorPicker/>
</Window>

Using last preview version of both colorpicker + avalonia

HsvProps Issues

I just cloned the repo to start trying to investigate this issue:

#22

When I launch the ColorPickerDemo project from within VS it immediately crashes in

private static bool ValidateSaturation(double? saturation)
{
    if (saturation is null)
    {
        return true;
    }
    if (saturation < 0.0 || saturation > 100.0)
    {
        throw new ArgumentException("Invalid Saturation value.");
    }
    return true;
}

The input saturation value is "100.00000000000001".

Application exits silently

Hello, I exported an BaseLight.xaml file and put inside my application and setup it as follow:

<Application xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Class="MyApp.App">
    <Application.Styles>
        <!-- <FluentTheme Mode="Light"/> -->
        <StyleInclude Source="resm:Avalonia.Themes.Default.DefaultTheme.xaml?assembly=Avalonia.Themes.Default"/>
        <StyleInclude Source="resm:MyApp.BaseLight.xaml?assembly=MyApp"/>
    </Application.Styles>
</Application>

Above is the application structure

image

But this change makes the application exits silently without an error.

Avalonia version - 0.10
latest ThemeEditor
dotnet 5.0

When Color Property is DataBound, when Null Crashes Application

When DataBinding the Color property to a property, when the property is null the ColorPicker crashes the application:

  at ThemeEditor.Controls.ColorPicker.Props.HsvProperties.ValidateValue(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/Props/HsvProperties.cs:line 54
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 98
   at Avalonia.AvaloniaObject.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 367
   at ThemeEditor.Controls.ColorPicker.Props.HsvProperties.set_Value(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/Props/HsvProperties.cs:line 83
   at ThemeEditor.Controls.ColorPicker.Props.HsvProperties.UpdatePropertyValues() in /_/src/ThemeEditor.Controls.ColorPicker/Props/HsvProperties.cs:line 105
   at ThemeEditor.Controls.ColorPicker.ColorPickerProperties.<OnColorPickerChange>b__12_2(Double _) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerProperties.cs:line 55
   at System.Reactive.AnonymousObserver`1.OnNextCore(T value) in /_/Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs:line 67
   at System.Reactive.ObserverBase`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:line 34
   at Avalonia.Reactive.LightweightObservableBase`1.PublishNext(T value) in /_/src/Avalonia.Base/Reactive/LightweightObservableBase.cs:line 139
   at Avalonia.Reactive.AvaloniaPropertyObservable`1.PropertyChanged(Object sender, AvaloniaPropertyChangedEventArgs e) in /_/src/Avalonia.Base/Reactive/AvaloniaPropertyObservable.cs:line 67
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 761
   at Avalonia.AvaloniaObject.Avalonia.PropertyStore.IValueSink.ValueChanged[T](AvaloniaPropertyChangedEventArgs`1 change) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 531
   at Avalonia.ValueStore.NotifyValueChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 355
   at Avalonia.ValueStore.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/ValueStore.cs:line 121
   at Avalonia.AvaloniaObject.SetValue[T](StyledPropertyBase`1 property, T value, BindingPriority priority) in /_/src/Avalonia.Base/AvaloniaObject.cs:line 367
   at ThemeEditor.Controls.ColorPicker.ColorPickerValuesPresenter.set_Value3(Double value) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerValuesPresenter.cs:line 56
   at ThemeEditor.Controls.ColorPicker.ColorPickerValuesPresenter.UpdateValuesFromThumbs() in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerValuesPresenter.cs:line 220
   at ThemeEditor.Controls.ColorPicker.ColorPickerValuesPresenter.OnColorChange() in /_/src/ThemeEditor.Controls.ColorPicker/ColorPickerValuesPresenter.cs:line 269
   at ThemeEditor.Controls.ColorPicker.ColorPicker.ArrangeOverride(Size finalSize) in /_/src/ThemeEditor.Controls.ColorPicker/ColorPicker.cs:line 80

Even specifying a binding Fallback value doesn't help.

Color="{Binding SelectedItem.Color, Converter={StaticResource ColorToStringConverter}, Mode=TwoWay, FallbackValue='#FFFFFFFF'}"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.