From e1e6789f7824c6a21f4d8c7288cf2cffe672ee00 Mon Sep 17 00:00:00 2001 From: robloo Date: Sun, 20 Mar 2022 23:05:29 -0400 Subject: [PATCH] Add ColorPicker base enums --- .../ColorPicker/ColorPickerHsvChannel.cs | 33 +++++++++++++ .../ColorSpectrum/IncrementAmount.cs | 23 ++++++++++ .../ColorSpectrum/IncrementDirection.cs | 23 ++++++++++ .../ColorPicker/ColorSpectrumChannels.cs | 46 +++++++++++++++++++ .../ColorPicker/ColorSpectrumShape.cs | 26 +++++++++++ 5 files changed, 151 insertions(+) create mode 100644 src/Avalonia.Controls/ColorPicker/ColorPickerHsvChannel.cs create mode 100644 src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementAmount.cs create mode 100644 src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementDirection.cs create mode 100644 src/Avalonia.Controls/ColorPicker/ColorSpectrumChannels.cs create mode 100644 src/Avalonia.Controls/ColorPicker/ColorSpectrumShape.cs diff --git a/src/Avalonia.Controls/ColorPicker/ColorPickerHsvChannel.cs b/src/Avalonia.Controls/ColorPicker/ColorPickerHsvChannel.cs new file mode 100644 index 0000000000..9e6e7cb89e --- /dev/null +++ b/src/Avalonia.Controls/ColorPicker/ColorPickerHsvChannel.cs @@ -0,0 +1,33 @@ +// This source file is adapted from the WinUI project. +// (https://github.com/microsoft/microsoft-ui-xaml) +// +// Licensed to The Avalonia Project under the MIT License. + +namespace Avalonia.Controls +{ + /// + /// Defines a specific HSV color model channel. + /// + public enum ColorPickerHsvChannel + { + /// + /// The Hue channel. + /// + Hue, + + /// + /// The Saturation channel. + /// + Saturation, + + /// + /// The Value channel. + /// + Value, + + /// + /// The Alpha channel. + /// + Alpha + }; +} diff --git a/src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementAmount.cs b/src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementAmount.cs new file mode 100644 index 0000000000..fd749cd7dc --- /dev/null +++ b/src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementAmount.cs @@ -0,0 +1,23 @@ +// This source file is adapted from the WinUI project. +// (https://github.com/microsoft/microsoft-ui-xaml) +// +// Licensed to The Avalonia Project under the MIT License. + +namespace Avalonia.Controls.Primitives +{ + /// + /// Defines a relative amount that a color channel should be incremented. + /// + internal enum IncrementAmount + { + /// + /// A smaller change in value. + /// + Small, + + /// + /// A larger change in value. + /// + Large, + }; +} diff --git a/src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementDirection.cs b/src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementDirection.cs new file mode 100644 index 0000000000..8002a44fc9 --- /dev/null +++ b/src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementDirection.cs @@ -0,0 +1,23 @@ +// This source file is adapted from the WinUI project. +// (https://github.com/microsoft/microsoft-ui-xaml) +// +// Licensed to The Avalonia Project under the MIT License. + +namespace Avalonia.Controls.Primitives +{ + /// + /// Defines the direction a color channel should be incremented. + /// + internal enum IncrementDirection + { + /// + /// Decreasing in value towards zero. + /// + Lower, + + /// + /// Increasing in value towards positive infinity. + /// + Higher, + }; +} diff --git a/src/Avalonia.Controls/ColorPicker/ColorSpectrumChannels.cs b/src/Avalonia.Controls/ColorPicker/ColorSpectrumChannels.cs new file mode 100644 index 0000000000..2b3f711634 --- /dev/null +++ b/src/Avalonia.Controls/ColorPicker/ColorSpectrumChannels.cs @@ -0,0 +1,46 @@ +// This source file is adapted from the WinUI project. +// (https://github.com/microsoft/microsoft-ui-xaml) +// +// Licensed to The Avalonia Project under the MIT License. + +using Avalonia.Controls.Primitives; + +namespace Avalonia.Controls +{ + /// + /// Defines the two HSV color channels displayed by a . + /// Order of the color channels is important. + /// + public enum ColorSpectrumChannels + { + /// + /// The Hue and Value channels. + /// + HueValue, + + /// + /// The Value and Hue channels. + /// + ValueHue, + + /// + /// The Hue and Saturation channels. + /// + HueSaturation, + + /// + /// The Saturation and Hue channels. + /// + SaturationHue, + + /// + /// The Saturation and Value channels. + /// + SaturationValue, + + /// + /// The Value and Saturation channels. + /// + ValueSaturation, + }; +} diff --git a/src/Avalonia.Controls/ColorPicker/ColorSpectrumShape.cs b/src/Avalonia.Controls/ColorPicker/ColorSpectrumShape.cs new file mode 100644 index 0000000000..0319d4a6c8 --- /dev/null +++ b/src/Avalonia.Controls/ColorPicker/ColorSpectrumShape.cs @@ -0,0 +1,26 @@ +// This source file is adapted from the WinUI project. +// (https://github.com/microsoft/microsoft-ui-xaml) +// +// Licensed to The Avalonia Project under the MIT License. + +using Avalonia.Controls.Primitives; + +namespace Avalonia.Controls +{ + /// + /// Defines the shape of a . + /// + public enum ColorSpectrumShape + { + /// + /// The spectrum is in the shape of a rectangular or square box. + /// Note that more colors are visible to the user in Box shape. + /// + Box, + + /// + /// The spectrum is in the shape of an ellipse or circle. + /// + Ring, + }; +}