Skip to content

Extensible and compact color selector implemented in C# with WPF. Works as both standalone (with test application) and as an imported Control.

License

Notifications You must be signed in to change notification settings

ptr-cs/Modern-Color-Selector

Repository files navigation

Modern-Color-Selector

    Extensible and compact color selector implemented in C# with WPF. Features highly-customizable default ControlTemplate and interactive 3D color models. Works as both standalone (with test application) and as an imported Control. Protoyped with Adobe XD and tested with NUnit unit testing framework.

Zeno Color Selector - Prototyped UI

Zeno Color Selector - Cube demo Zeno Color Selector - Cone demo Zeno Color Selector - Menu demo

Features

  • .JSON file import and export support for loading and saving colors
  • Drag-and-drop support for loading .JSON files when drag-dropping over the Presets and Custom color selectors
  • Dynamic application scale controls, allowing the user to increase the scale of the entire interface if needed.
  • Versatile color selector with modern user interface (UI) and emphasis on user experience (UX)
  • 3D interactive RGB cube and HSV cone color models with click-drag and mouse-wheel support for edit actions
  • Menu with options to control visibility of individual color editor components
  • Clipboard paste support for hexadecimal color strings - paste directly into the Control at any location
  • Ability to define a custom set of preset colors and save custom colors at runtime
  • Supports RGB, HSL, and HSV color modes, with hexadecimal RGBA string support
  • Error-checking for input fields with validation feedback
  • Minimal code footprint (two main files - ColorSelector.cs and Themes/Generic.xaml, with organized supporting files)
  • Easy to import as a control library into other WPF projects
  • Completely customizable, based on ControlTemplates
  • Functions well in nearly any window size, from narrow-wdith window to full-screen

For a more detailed explanation of the code, a blog post about the project is available here.

Setup

    The repository consists of three Visual Studio projects - the ColorSelector project, a companion standalone application project, and an NUnit unit testing project. Opening the ColorSelector/ColorSelector.sln file in Visual Studio should allow all projects to be built and run. To use the ColorSelector as a Control in another WPF application, add the ColorSelector project to the parent solution in Visual Studio, then add a project reference to the ColorSelector project for any projects that will use the ColorSelector.

In-Progress

  • Menu settings for number of presets and custom colors
  • Configuration settings support

Screenshots

Zeno Color Selector - HSL color mode Zeno Color Selector - Menu Zeno Color Selector - Condensed Window Zeno Color Selector - Wide Window Zeno Color Selector - Horizontal layout mode

Adobe XD Prototype

Zeno Color Selector - Adobe XD artboards