Home

Awesome

AvaloniaColorPicker: a color picker for Avalonia

<img src="icon.svg" width="256" align="right">

License: LGPL v3 Version

AvaloniaColorPicker is a colour picker control for Avalonia, with support for RGB, HSB and CIELAB colour spaces, palettes and colour blindness simulation.

The library contains three main controls:

In addition, the library contains a number of controls and interfaces that can be used to customise the interface of the colour picker.

The library is released under the LGPLv3 licence.

<img src="screenshot.png">

Getting started

The library targets .NET Standard 2.0, thus it can be used in projects that target .NET Standard 2.0+ and .NET Core 2.0+.

To use the library in your project, you should install the AvaloniaColorPicker Nuget package.

This repository also contains three very simple demo projects, one using the ColorButton control, one using the ColorPicker control, and one showing how to create a custom colour picker interface using the CustomColorPicker control.

Usage

You will need to add the relevant using directive (in C# code) or the XML namespace (in the XAML code). You can then add controls from the AvaloniaColorPicker namespace. For example

<Window ...
        xmlns:colorpicker="clr-namespace:AvaloniaColorPicker;assembly=AvaloniaColorPicker">
  ...
    <colorpicker:ColorButton Color="#56B4E9"></colorpicker:ColorButton>
  ...
</Window>

The Wiki for this repository contains more information about the controls included in the library and how they can be used.

Source code

The source code for the library is available in this repository. In addition to the AvaloniaColorPicker library project and the three demo applications, the repository also contains a project for an application that is used to generate the LabColorSpace.bin cache file that is used by AvaloniaColorPicker to display 3D "sections" of the CIELAB colour space.