├── .gitattributes ├── .gitignore ├── LICENSE.md ├── README.md ├── images ├── example-avalonia-1.png ├── example-avalonia-2.png ├── example-avalonia-3.png ├── example-wpf-1.png ├── example-wpf-2.png ├── example-wpf-3.png ├── example-wpf-4.png └── example-wpf-mahapps-1.png └── src ├── AvaloniaUI ├── Egorozh.ColorPicker.Avalonia.Dialog │ ├── Controls │ │ ├── ColorPickerButton.cs │ │ ├── ColorPickerDialog.axaml │ │ └── ColorPickerDialog.axaml.cs │ ├── Egorozh.ColorPicker.Avalonia.Dialog.csproj │ ├── Egorozh.ColorPicker.Avalonia.Dialog.csproj.DotSettings │ └── Themes │ │ ├── FluentTheme.axaml │ │ ├── FluentTheme.axaml.cs │ │ ├── SimpleTheme.axaml │ │ └── SimpleTheme.axaml.cs └── Egorozh.ColorPicker.Avalonia │ ├── ColorPickerControl.cs │ ├── Controls │ ├── ColorEditor.cs │ ├── ColorHexComboBox.cs │ ├── ColorListItem.cs │ ├── ColorPalette.cs │ ├── ColorPickerButtonBase.cs │ ├── ColorPreview.cs │ ├── ColorWheel.cs │ ├── NumUpDowns │ │ ├── Base │ │ │ └── LabelNumericUpDown.cs │ │ ├── Hsv │ │ │ ├── HueColorNumUpDown.cs │ │ │ ├── SaturationColorNumUpDown.cs │ │ │ └── ValueColorNumUpDown.cs │ │ └── RgbaColorNumericUpDown.cs │ └── Sliders │ │ ├── Base │ │ └── ColorSlider.cs │ │ ├── Hsv │ │ ├── HueColorSlider.cs │ │ ├── SaturationColorSlider.cs │ │ └── ValueColorSlider.cs │ │ └── RgbaColorSlider.cs │ ├── Egorozh.ColorPicker.Avalonia.csproj │ ├── Egorozh.ColorPicker.Avalonia.csproj.DotSettings │ ├── GlobalUsings.cs │ ├── Helpers │ └── ColorConvertExtensions.cs │ ├── Themes │ ├── Controls │ │ ├── ColorPickerButton.axaml │ │ ├── Default │ │ │ ├── ColorEditor.axaml │ │ │ ├── ColorHexComboBox.axaml │ │ │ ├── ColorPalette.axaml │ │ │ ├── ColorPicker.axaml │ │ │ ├── ColorPreview.axaml │ │ │ ├── ColorSlider.axaml │ │ │ ├── ColorWheel.axaml │ │ │ ├── LabelNumericUpDown.axaml │ │ │ ├── ModeListBox.axaml │ │ │ └── Tabs.axaml │ │ └── Fluent │ │ │ ├── ColorEditor.axaml │ │ │ ├── ColorHexComboBox.axaml │ │ │ ├── ColorPalette.axaml │ │ │ ├── ColorPicker.axaml │ │ │ ├── ColorPreview.axaml │ │ │ ├── ColorSlider.axaml │ │ │ ├── ColorWheel.axaml │ │ │ ├── LabelNumericUpDown.axaml │ │ │ ├── ModeListBox.axaml │ │ │ └── Tabs.axaml │ ├── Default.axaml │ ├── Fluent.axaml │ └── Others │ │ ├── Brushes.axaml │ │ └── Icons.axaml │ └── ValueConverters │ ├── AccentColorShadeConverter.cs │ ├── Base │ └── BaseValueConverter.cs │ ├── ColorToSolidColorBrushConverter.cs │ ├── DivideDoubleToCornerRadiusConverter.cs │ └── DivideDoubleToDoubleConverter.cs ├── ColorPicker.sln ├── Core └── ColorPicker.Shared │ ├── ColorManager.cs │ ├── ColorPicker.Shared.projitems │ ├── ColorPicker.Shared.shproj │ ├── Colors │ ├── HslColor.cs │ └── HsvColor.cs │ ├── Core │ ├── IColorClient.cs │ └── IColorManager.cs │ ├── Enums │ └── RgbaChannel.cs │ ├── Helpers │ ├── ColorWheelHelpers.cs │ └── HexComboBoxHelpers.cs │ ├── Models │ └── NamedColor.cs │ └── Palette │ ├── ColorPaletteType.cs │ ├── ColorPalettes.cs │ └── Serializers │ ├── AdobeColorTablePaletteSerializer.cs │ ├── AdobePhotoshopColorSwatchSerializer.cs │ ├── Core │ ├── IPaletteSerializer.cs │ └── PaletteSerializer.cs │ ├── GimpPaletteSerializer.cs │ ├── InterleavedBitmapPaletteSerializer.cs │ ├── JascPaletteSerializer.cs │ ├── PaintNetPaletteSerializer.cs │ └── RawPaletteSerializer.cs ├── Directory.Build.props ├── LICENSE.md ├── Samples ├── Egorozh.ColorPicker.Avalonia.Client │ ├── App.axaml │ ├── App.axaml.cs │ ├── Assets │ │ └── avalonia-logo.ico │ ├── Egorozh.ColorPicker.Avalonia.Client.csproj │ ├── Egorozh.ColorPicker.Avalonia.Client.csproj.DotSettings │ ├── Program.cs │ ├── Views │ │ ├── MainWindow.axaml │ │ └── MainWindow.axaml.cs │ └── nuget.config ├── Egorozh.ColorPicker.WPF.Client │ ├── App.xaml │ ├── App.xaml.cs │ ├── AssemblyInfo.cs │ ├── Egorozh.ColorPicker.WPF.Client.csproj │ ├── MainWindow.xaml │ └── MainWindow.xaml.cs └── Egorozh.ColorPicker.WPF.MahApps.Client │ ├── App.xaml │ ├── App.xaml.cs │ ├── AssemblyInfo.cs │ ├── Egorozh.ColorPicker.WPF.MahApps.Client.csproj │ ├── MainWindow.xaml │ └── MainWindow.xaml.cs └── WPF ├── Egorozh.ColorPicker.WPF.Dialog.MahApps ├── AssemblyInfo.cs ├── Controls │ ├── ColorPickerButton.cs │ ├── ColorPickerDialog.xaml │ └── ColorPickerDialog.xaml.cs ├── Egorozh.ColorPicker.WPF.Dialog.MahApps.csproj ├── Egorozh.ColorPicker.WPF.Dialog.MahApps.csproj.DotSettings └── Themes │ ├── Controls │ ├── ColorHexComboBox.xaml │ ├── ColorSlider.xaml │ ├── LabelNumericUpDown.xaml │ └── ModeListBox.xaml │ └── Generic.xaml ├── Egorozh.ColorPicker.WPF.Dialog ├── Controls │ ├── ColorPickerButton.cs │ ├── ColorPickerDialog.xaml │ └── ColorPickerDialog.xaml.cs ├── Egorozh.ColorPicker.WPF.Dialog.csproj └── Egorozh.ColorPicker.WPF.Dialog.csproj.DotSettings └── Egorozh.ColorPicker.WPF ├── AssemblyInfo.cs ├── ColorPickerControl.cs ├── Controls ├── ColorEditor.cs ├── ColorHexComboBox.cs ├── ColorPalette.cs ├── ColorPickerButtonBase.cs ├── ColorPreview.cs ├── ColorWheel.cs ├── NumUpDowns │ ├── Base │ │ ├── LabelNumericUpDown.cs │ │ └── NumericUpDown.cs │ ├── Hsv │ │ ├── HueColorNumUpDown.cs │ │ ├── SaturationColorNumUpDown.cs │ │ └── ValueColorNumUpDown.cs │ └── RgbaColorNumericUpDown.cs ├── ScreenColorPicker.cs └── Sliders │ ├── Base │ └── ColorSlider.cs │ ├── Hsv │ ├── HueColorSlider.cs │ ├── SaturationColorSlider.cs │ └── ValueColorSlider.cs │ └── RgbaColorSlider.cs ├── Egorozh.ColorPicker.WPF.csproj ├── Egorozh.ColorPicker.WPF.csproj.DotSettings ├── GlobalUsings.cs ├── Helpers ├── ColorConvertExtensions.cs └── NativeMethods.cs ├── Resources ├── HsvWheelEffect.ps └── eyedropper.cur ├── Themes ├── Controls │ ├── ColorEditor.xaml │ ├── ColorHexComboBox.xaml │ ├── ColorPalette.xaml │ ├── ColorPickerButton.xaml │ ├── ColorPickerControl.xaml │ ├── ColorPreview.xaml │ ├── ColorSlider.xaml │ ├── ColorWheel.xaml │ ├── LabelNumericUpDown.xaml │ ├── ModeListBox.xaml │ ├── ScreenColorPicker.xaml │ └── Tabs.xaml ├── Generic.xaml └── Others │ ├── Brushes.xaml │ └── Icons.xaml └── ValueConverters ├── AccentColorShadeConverter.cs ├── BoolToVisibilityConverter.cs ├── ColorToSolidColorBrushConverter.cs ├── DivideDoubleToCornerRadiusConverter.cs └── DivideDoubleToDoubleConverter.cs /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Zheludkov Egor 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Nuget (with prereleases)](https://img.shields.io/nuget/v/Egorozh.ColorPicker.Avalonia.Dialog?label=avalonia-nuget&style=plastic)](https://www.nuget.org/packages/Egorozh.ColorPicker.Avalonia.Dialog/) [![Nuget (with prereleases)](https://img.shields.io/nuget/v/Egorozh.ColorPicker.WPF.Dialog?label=wpf-nuget&style=plastic)](https://www.nuget.org/packages/Egorozh.ColorPicker.WPF.Dialog/) [![Nuget (with prereleases)](https://img.shields.io/nuget/v/Egorozh.ColorPicker.WPF.Dialog.MahApps?label=wpf-mahapps-nuget&style=plastic)](https://www.nuget.org/packages/Egorozh.ColorPicker.WPF.Dialog.MahApps/) 2 | 3 | # Egorozh.ColorPicker 4 | 5 | ## AvaloniaUI ColorPicker: 6 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-avalonia-1.png "Пример диалогого окна") 7 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-avalonia-2.png "Пример диалогого окна") 8 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-avalonia-3.png "Пример диалогого окна") 9 | 10 | ### AvaloniaUI Getting Started 11 | 12 | Install the library as a NuGet package: 13 | 14 | ```powershell 15 | Install-Package Egorozh.ColorPicker.Avalonia.Dialog 16 | # Or 'dotnet add package Egorozh.ColorPicker.Avalonia.Dialog' 17 | ``` 18 | 19 | Then, reference the preffered theme from your `App.xaml` file: 20 | 21 | ```xml 22 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | ``` 40 | Done! Use ColorPickerButton 41 | ```xml 42 | 44 | ``` 45 | or ColorPickerDialog: 46 | ```c# 47 | ColorPickerDialog dialog = new () 48 | { 49 | Color = _color 50 | }; 51 | 52 | var res = await dialog.ShowDialog(Owner); 53 | 54 | if (res) 55 | _color = dialog.Color; 56 | ``` 57 | 58 | ## WPF ColorPicker: 59 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-wpf-1.png "Пример диалогого окна") 60 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-wpf-2.png "Пример диалогого окна") 61 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-wpf-3.png "Пример диалогого окна") 62 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-wpf-4.png "Пример диалогого окна") 63 | ![example](https://github.com/egorozh/Egorozh.ColorPicker.WPF/blob//v2.0/images/example-wpf-mahapps-1.png "MahApps") 64 | 65 | ### WPF Getting Started 66 | 67 | Install the library as a NuGet package: 68 | 69 | ```powershell 70 | Install-Package Egorozh.ColorPicker.WPF.Dialog 71 | # Or 'dotnet add package Egorozh.ColorPicker.WPF.Dialog' 72 | ``` 73 | Done! Use ColorPickerButton 74 | ```xml 75 | 77 | ``` 78 | or ColorPickerDialog: 79 | ```c# 80 | var dialog = new ColorPickerDialog 81 | { 82 | Owner = Owner, 83 | Color = Color 84 | }; 85 | 86 | var res = dialog.ShowDialog(); 87 | 88 | if (res == true) 89 | Color = dialog.Color; 90 | ``` 91 | ### To run MahApps Version: 92 | Install the library as a NuGet package: 93 | 94 | ```powershell 95 | Install-Package Egorozh.ColorPicker.WPF.Dialog.MahApps 96 | # Or 'dotnet add Egorozh.ColorPicker.WPF.Dialog.MahApps' 97 | ``` 98 | Then, reference the preffered theme from your `App.xaml` file: 99 | 100 | ```xml 101 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | ``` 121 | -------------------------------------------------------------------------------- /images/example-avalonia-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-avalonia-1.png -------------------------------------------------------------------------------- /images/example-avalonia-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-avalonia-2.png -------------------------------------------------------------------------------- /images/example-avalonia-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-avalonia-3.png -------------------------------------------------------------------------------- /images/example-wpf-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-wpf-1.png -------------------------------------------------------------------------------- /images/example-wpf-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-wpf-2.png -------------------------------------------------------------------------------- /images/example-wpf-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-wpf-3.png -------------------------------------------------------------------------------- /images/example-wpf-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-wpf-4.png -------------------------------------------------------------------------------- /images/example-wpf-mahapps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/egorozh/Egorozh.ColorPicker/afc29979288300121aba52aeb283b8b22ce432c7/images/example-wpf-mahapps-1.png -------------------------------------------------------------------------------- /src/AvaloniaUI/Egorozh.ColorPicker.Avalonia.Dialog/Controls/ColorPickerButton.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace Egorozh.ColorPicker.Dialog; 4 | 5 | public class ColorPickerButton : ColorPickerButtonBase 6 | { 7 | protected override async Task ChangeColor() 8 | { 9 | ColorPickerDialog dialog = new() 10 | { 11 | Color = Color, 12 | Colors = Colors 13 | }; 14 | 15 | var res = await dialog.ShowDialog(Owner); 16 | 17 | if (res) 18 | Color = dialog.Color; 19 | } 20 | } -------------------------------------------------------------------------------- /src/AvaloniaUI/Egorozh.ColorPicker.Avalonia.Dialog/Controls/ColorPickerDialog.axaml: -------------------------------------------------------------------------------- 1 |  22 | 23 | 25 | 26 | 29 | 30 | 34 | 35 |