This element is one more control from the ColorPicker constituent controls bug in addition to the published in my recent posts.
LuminositySlider control is designed as the selector of the Color with the HSL Color model Luminosity ranging from 0 to 1. It’s the extension of the
LuminositySlider is provided with the reference Color through the
BaseColor Dependency Property. It displays that reference Color gradient starting from the reference Color with the Luminosity set to 0 up to the Color with the Luminosity of 1.
That is the sample:
At the top is the RainbowSlider allowing to select the BaseColor for two
LuminositySliders (horizontal and vertical) below it.
LuminositySlider has read-only
SelectedColor Dependency Property used to get the value of the Color selected. This property value is synchronized with
Value properties values of the parent
Slider control. The caller can set the desired luminance value from the code as follows:
Value = Luminance * (Maximum - Minimum) + Minimum;
SelectedColor changes the
LuminositySlider raises the
The direction the Luminosity value changes depends on the value of
IsDirectionReversed property. If it’s false (the default) the minimum Luminosity is at the left or at the bottom of the control depending on the orientation.
You can download the code and the samples here:
The archive contains my WPFGears library with samples, tests, etc. It’s the Visual Studio 2008 SP1 solution targeted to .NET Framework 3.5.
You’ll find LuminositySliderSample project there.
LuminositySlider element code is in the WPFGears library project ColorPickerControls folder.
Oleg V. Polikarpotchkin