mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
[ColorPicker] CMYK, HSV and HSL color format (#6975)
* Add HSL and HSV color formats + cleanup + docu * Fix build problem (lang version) * Add CYMK color + replace float with double values * ups - fix cmyk text format * fix wrong settings text + doc typo fix * Address feedback * Address feedback + fix to small window size * adress feedback + more cleanup * typo fix * Avoid possible division by zero + unit test * Address feedback - move all represenation to own helper class + UnitTest * Address feedback -> switch to mstest framework
This commit is contained in:
@@ -9,8 +9,30 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
{
|
||||
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
|
||||
@@ -31,8 +53,6 @@ namespace Microsoft.PowerToys.Settings.UI.Lib
|
||||
public ColorRepresentationType CopiedColorRepresentation { get; set; }
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return JsonSerializer.Serialize(this);
|
||||
}
|
||||
=> JsonSerializer.Serialize(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,10 @@
|
||||
Width="240"
|
||||
IsEnabled="{Binding IsEnabled}">
|
||||
<ComboBoxItem Content="HEX - #FFAA00"/>
|
||||
<ComboBoxItem Content="RGB - RGB(100, 50, 75)"/>
|
||||
<ComboBoxItem Content="RGB - rgb(100, 50, 75)"/>
|
||||
<ComboBoxItem Content="CMYK - cmyk(100%, 50%, 75%, 0%)"/>
|
||||
<ComboBoxItem Content="HSL - hsl(100, 50%, 75%)"/>
|
||||
<ComboBoxItem Content="HSV - hsv(100, 50%, 75%)"/>
|
||||
</ComboBox>
|
||||
|
||||
<!--
|
||||
|
||||
Reference in New Issue
Block a user