All Projects → PixiEditor → ColorPicker

PixiEditor / ColorPicker

Licence: MIT License
Customizable Color Picker control for WPF

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to ColorPicker

Toastnotifications
Toast notifications for WPF allows you to create and display rich notifications in WPF applications. It's highly configurable with set of built-in options like positions, behaviours, themes and many others. It's extendable, it gives you possibility to create custom and interactive notifications in simply manner.
Stars: ✭ 507 (+789.47%)
Mutual labels:  xaml, control, nuget, wpf
Handycontrols
Contains some simple and commonly used WPF controls based on HandyControl
Stars: ✭ 347 (+508.77%)
Mutual labels:  xaml, control, color-picker, wpf
Aura.ui
A Library with a lot of Controls for AvaloniaUI
Stars: ✭ 114 (+100%)
Mutual labels:  xaml, control, nuget, wpf
vscode-color
Helper with GUI to generate color codes such as CSS color notations.
Stars: ✭ 88 (+54.39%)
Mutual labels:  color-picker, hsl, rgb, hsv
Handycontrol
Contains some simple and commonly used WPF controls
Stars: ✭ 3,349 (+5775.44%)
Mutual labels:  xaml, control, color-picker, wpf
Hsluv Dart
Dart port of HSLuv, a human-friendly alternative to HSL based on human experiments.
Stars: ✭ 49 (-14.04%)
Mutual labels:  color-picker, hsl, rgb
React Colorpickr
A themeable colorpicker with HSL and RGB support for React
Stars: ✭ 180 (+215.79%)
Mutual labels:  color-picker, hsl, rgb
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (+112.28%)
Mutual labels:  nuget, colors, rgb
Sorted Colors
A tool to sort the named CSS colors in a way that it shows related colors together
Stars: ✭ 167 (+192.98%)
Mutual labels:  colors, hsl, rgb
Controlzex
Shared Controlz for WPF and ... more
Stars: ✭ 561 (+884.21%)
Mutual labels:  xaml, control, wpf
Fluent.ribbon
WPF Ribbon control like in Office
Stars: ✭ 1,895 (+3224.56%)
Mutual labels:  xaml, control, wpf
Color Studio
It is too hard to build coherent and accessible themes with the right colors. This should help.
Stars: ✭ 289 (+407.02%)
Mutual labels:  color-picker, hsl, rgb
Gradstop
JavaScript micro library to generate gradient color stops 🏳️‍🌈
Stars: ✭ 144 (+152.63%)
Mutual labels:  colors, hsl, rgb
Values.js
🍇 Get the tints and shades of a color
Stars: ✭ 97 (+70.18%)
Mutual labels:  colors, hsl, rgb
ColorPickerLib
A WPF/MVVM implementation of a themeable color picker control.
Stars: ✭ 44 (-22.81%)
Mutual labels:  control, color-picker, wpf
andColorPicker
Color picker library for Android
Stars: ✭ 233 (+308.77%)
Mutual labels:  color-picker, hsl, rgb
React Color Extractor
A React component which extracts colors from an image
Stars: ✭ 314 (+450.88%)
Mutual labels:  colors, hsl, rgb
global-color-picker
start the script and click anywhere to get rgb value at the cursor location
Stars: ✭ 31 (-45.61%)
Mutual labels:  color-picker, colors, rgb
ColorHelper
No description or website provided.
Stars: ✭ 34 (-40.35%)
Mutual labels:  hsl, rgb, hsv
colors-convert
🦚 A simple colors library
Stars: ✭ 15 (-73.68%)
Mutual labels:  colors, hsl, rgb

Discord Server Download Downloads

About

A collection of various WPF controls used to select colors. Supports .NET Framework 4.5.1+, .NET Core 3.1+, .NET 5 and .NET 6. Originally developed for PixiEditor.

screenshot

  1. Included Controls
  2. Example Usage
  3. Properties
  4. Styling
  5. Other

Included Controls

  • SquarePicker: A HSV/HSL Color Picker, consists of a circular hue slider and HV/HL square.
  • ColorSliders: A set of HSV/RGB + Alpha sliders
  • HexColorTextBox: An RGBA Hex text field
  • ColorDisplay: A Primary/Secondary Color display with a swap button
  • StandardColorPicker: Combines everything listed above in one control
  • PortableColorPicker: A collapsible version of StandardColorPicker
  • AlphaSlider: A separate alpha slider control

demo project

Example Usage

See ColorPickerDemo for an example project.

Basic usage:

Install the NuGet package, insert a reference to the ColorPicker namespace

<Window ...
xmlns:colorpicker="clr-namespace:ColorPicker;assembly=ColorPicker"
...>

Add the controls

<colorpicker:StandardColorPicker x:Name="main" Width="200" Height="380"/>
<colorpicker:PortableColorPicker ColorState="{Binding ElementName=main, Path=ColorState, Mode=TwoWay}" Width="40" Height="40"/>

Note: in some configurations such as using the package in .NET Framework 4.7 the XAML designer tends to break and not show the control.

Properties

All controls share these properties:

  • SelectedColor dependency property stores the current color as System.Windows.Media.Color
  • ColorChanged: An event that fires on SelectedColor change.
  • ColorState dependency property contains all info about the current state of the control. Use this property to bind controls together.
  • Color property contains nested properties you may bind to or use to retrieve the color in code-behind:
    • Color.A: Current Alpha, a double ranging from 0 to 255
    • Color.RGB_R, Color.RGB_G, Color.RGB_B: Dimensions of the RGB color space, each is a 0-255 double
    • Color.HSV_H: Hue in the HSV color space, a 0-360 double
    • Color.HSV_S: Saturation in the HSV color space, a 0-100 double
    • Color.HSV_V: Value in the HSV color space, a 0-100 double
    • Color.HSL_H: Hue in the HSL color space, a 0-360 double
    • Color.HSL_S: Saturation in the HSL color space, a 0-100 double
    • Color.HSL_L: Lightness in the HSL color space, a 0-100 double

Apart from those, some controls have unique properties:

  • SecondColorState, SecondColor, and SecondaryColor are functionally identical to ColorState, Color, and SelectedColor respectively. These are present on controls that have a secondary color.
  • SmallChange lets you change SmallChange of sliders, which is used as sensitivity for when the user turns the scroll wheel with the cursor over the sliders. Present on controls with sliders.
  • ShowAlpha lets you hide the alpha channel on various controls. Present on all controls containing either an alpha slider (apart from the AlphaSlider control itself) or a hex color textbox.
  • PickerType: HSV or HSL, present on SquarePicker or controls that contain SquarePicker.

Styling

Out of the box, the color picker uses the default WPF look:

Default ColorPicker look

You may use the included dark theme by loading a resource dictionary in XAML:

<Window.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Window.Resources>

and referencing DefaultColorPickerStyle in the style attribute of a control:

<colorpicker:StandardColorPicker Style="{StaticResource DefaultColorPickerStyle}" />

As an alternative, the same can be achieved programmatically:

var resourceDictionary = new ResourceDictionary();
resourceDictionary.Source = new System.Uri(
    "pack://application:,,,/ColorPicker;component/Styles/DefaultColorPickerStyle.xaml",
    System.UriKind.RelativeOrAbsolute);

StandardColorPicker picker = new StandardColorPicker()
{
    Style = (Style)resourceDictionary["DefaultColorPickerStyle"]
};

You may define your own styles, see DefaultColorPickerStyle for reference.

Other

Read flabbet's article on the theory behind the first version of this project on dev.to

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].