Add Ncol, HWB, HSB color format + cleanup

This commit is contained in:
Sekan, Tobias
2020-10-23 14:32:57 +02:00
parent d9de059a4f
commit 57dd0ce113
10 changed files with 260 additions and 98 deletions

View File

@@ -4,37 +4,10 @@
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
namespace Microsoft.PowerToys.Settings.UI.Library
{
public enum ColorRepresentationType
{
/// <summary>
/// Color presentation as hexadecimal color value without the alpha-value (e.g. #0055FF)
/// </summary>
HEX = 0,
/// <summary>
/// Color presentation as RGB color value (red[0..255], green[0..255], blue[0..255])
/// </summary>
RGB = 1,
/// <summary>
/// Color presentation as CMYK color value (cyan[0%..100%], magenta[0%..100%], yellow[0%..100%], black key[0%..100%])
/// </summary>
CMYK = 2,
/// <summary>
/// Color presentation as HSL color value (hue[0°..360°], saturation[0..100%], lightness[0%..100%])
/// </summary>
HSL = 3,
/// <summary>
/// Color presentation as HSV color value (hue[0°..360°], saturation[0%..100%], value[0%..100%])
/// </summary>
HSV = 4,
}
public class ColorPickerProperties
{
public ColorPickerProperties()

View File

@@ -40,14 +40,10 @@ namespace Microsoft.PowerToys.Settings.UI.Library
}
public string GetModuleName()
{
return Name;
}
=> Name;
// This can be utilized in the future if the settings.json file is to be modified/deleted.
public bool UpgradeSettingsConfiguration()
{
return false;
}
=> false;
}
}

View File

@@ -0,0 +1,54 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
namespace Microsoft.PowerToys.Settings.UI.Library.Enumerations
{
public enum ColorRepresentationType
{
/// <summary>
/// Color presentation as hexadecimal color value without the alpha-value (e.g. #0055FF)
/// </summary>
HEX = 0,
/// <summary>
/// Color presentation as RGB color value (red[0..255], green[0..255], blue[0..255])
/// </summary>
RGB = 1,
/// <summary>
/// Color presentation as CMYK color value (cyan[0%..100%], magenta[0%..100%], yellow[0%..100%], black key[0%..100%])
/// </summary>
CMYK = 2,
/// <summary>
/// Color presentation as HSL color value (hue[0°..360°], saturation[0..100%], lightness[0%..100%])
/// </summary>
HSL = 3,
/// <summary>
/// Color presentation as HSV color value (hue[0°..360°], saturation[0%..100%], value[0%..100%])
/// </summary>
HSV = 4,
/// <summary>
/// Color presentation as HSB color value (hue[0°..360°], saturation[0%..100%], brightness[0%..100%])
/// </summary>
HSB = 5,
/// <summary>
/// Color presentation as HSI color value (hue[0°..360°], saturation[0%..100%], value[0%..100%])
/// </summary>
HSI = 6,
/// <summary>
/// Color presentation as HWB color value (hue[0°..360°], whiteness[0%..100%], blackness[0%..100%])
/// </summary>
HWB = 7,
/// <summary>
/// Color presentation as natural color (hue, saturation[0%..100%], value[0%..100%])
/// </summary>
NCol = 8,
}
}

View File

@@ -5,6 +5,7 @@
using System;
using System.Globalization;
using System.Text.Json;
using Microsoft.PowerToys.Settings.UI.Library.Enumerations;
using Microsoft.PowerToys.Settings.UI.Library.Helpers;
using Microsoft.PowerToys.Settings.UI.Library.Interfaces;

View File

@@ -74,6 +74,10 @@
<ComboBoxItem Content="CMYK - cmyk(100%, 50%, 75%, 0%)"/>
<ComboBoxItem Content="HSL - hsl(100, 50%, 75%)"/>
<ComboBoxItem Content="HSV - hsv(100, 50%, 75%)"/>
<ComboBoxItem Content="HSB - hsb(100, 50%, 75%)"/>
<ComboBoxItem Content="HSI - hsi(100, 50%, 75%)"/>
<ComboBoxItem Content="HBW - hbw(100, 50%, 75%)"/>
<ComboBoxItem Content="NCob - 10R, 50%, 75%"/>
</ComboBox>
<!--