Browse Source

Add ColorPicker base enums

pull/7842/head
robloo 5 years ago
parent
commit
e1e6789f78
  1. 33
      src/Avalonia.Controls/ColorPicker/ColorPickerHsvChannel.cs
  2. 23
      src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementAmount.cs
  3. 23
      src/Avalonia.Controls/ColorPicker/ColorSpectrum/IncrementDirection.cs
  4. 46
      src/Avalonia.Controls/ColorPicker/ColorSpectrumChannels.cs
  5. 26
      src/Avalonia.Controls/ColorPicker/ColorSpectrumShape.cs

33
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
{
/// <summary>
/// Defines a specific HSV color model channel.
/// </summary>
public enum ColorPickerHsvChannel
{
/// <summary>
/// The Hue channel.
/// </summary>
Hue,
/// <summary>
/// The Saturation channel.
/// </summary>
Saturation,
/// <summary>
/// The Value channel.
/// </summary>
Value,
/// <summary>
/// The Alpha channel.
/// </summary>
Alpha
};
}

23
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
{
/// <summary>
/// Defines a relative amount that a color channel should be incremented.
/// </summary>
internal enum IncrementAmount
{
/// <summary>
/// A smaller change in value.
/// </summary>
Small,
/// <summary>
/// A larger change in value.
/// </summary>
Large,
};
}

23
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
{
/// <summary>
/// Defines the direction a color channel should be incremented.
/// </summary>
internal enum IncrementDirection
{
/// <summary>
/// Decreasing in value towards zero.
/// </summary>
Lower,
/// <summary>
/// Increasing in value towards positive infinity.
/// </summary>
Higher,
};
}

46
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
{
/// <summary>
/// Defines the two HSV color channels displayed by a <see cref="ColorSpectrum"/>.
/// Order of the color channels is important.
/// </summary>
public enum ColorSpectrumChannels
{
/// <summary>
/// The Hue and Value channels.
/// </summary>
HueValue,
/// <summary>
/// The Value and Hue channels.
/// </summary>
ValueHue,
/// <summary>
/// The Hue and Saturation channels.
/// </summary>
HueSaturation,
/// <summary>
/// The Saturation and Hue channels.
/// </summary>
SaturationHue,
/// <summary>
/// The Saturation and Value channels.
/// </summary>
SaturationValue,
/// <summary>
/// The Value and Saturation channels.
/// </summary>
ValueSaturation,
};
}

26
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
{
/// <summary>
/// Defines the shape of a <see cref="ColorSpectrum"/>.
/// </summary>
public enum ColorSpectrumShape
{
/// <summary>
/// The spectrum is in the shape of a rectangular or square box.
/// Note that more colors are visible to the user in Box shape.
/// </summary>
Box,
/// <summary>
/// The spectrum is in the shape of an ellipse or circle.
/// </summary>
Ring,
};
}
Loading…
Cancel
Save