mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 18:26:39 +02:00
correct order + correct docu
This commit is contained in:
@@ -24,13 +24,13 @@ namespace ColorPicker.Helpers
|
||||
=> colorRepresentationType switch
|
||||
{
|
||||
ColorRepresentationType.CMYK => ColorToCYMK(color),
|
||||
ColorRepresentationType.NCol => ColorToNCol(color),
|
||||
ColorRepresentationType.HEX => ColorToHex(color),
|
||||
ColorRepresentationType.HSB => ColorToHSB(color),
|
||||
ColorRepresentationType.HSI => ColorToHSI(color),
|
||||
ColorRepresentationType.HSL => ColorToHSL(color),
|
||||
ColorRepresentationType.HSV => ColorToHSV(color),
|
||||
ColorRepresentationType.HWB => ColorToHWB(color),
|
||||
ColorRepresentationType.NCol => ColorToNCol(color),
|
||||
ColorRepresentationType.RGB => ColorToRGB(color),
|
||||
|
||||
// Fall-back value, when "_userSettings.CopiedColorRepresentation.Value" is incorrect
|
||||
@@ -57,23 +57,6 @@ namespace ColorPicker.Helpers
|
||||
+ $", {blackKey.ToString(CultureInfo.InvariantCulture)}%)";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a <see cref="string"/> representation of a natural color
|
||||
/// </summary>
|
||||
/// <param name="color">The <see cref="Color"/> for the natural color presentation</param>
|
||||
/// <returns>A <see cref="string"/> representation of a natural color</returns>
|
||||
private static string ColorToNCol(Color color)
|
||||
{
|
||||
var (hue, whiteness, blackness) = ColorHelper.ConvertToNaturalColor(color);
|
||||
|
||||
whiteness = Math.Round(whiteness * 100);
|
||||
blackness = Math.Round(blackness * 100);
|
||||
|
||||
return $"{hue}"
|
||||
+ $", {whiteness.ToString(CultureInfo.InvariantCulture)}%"
|
||||
+ $", {blackness.ToString(CultureInfo.InvariantCulture)}%";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a hexadecimal <see cref="string"/> representation of a RGB color
|
||||
/// </summary>
|
||||
@@ -176,6 +159,23 @@ namespace ColorPicker.Helpers
|
||||
+ $", {blackness.ToString(CultureInfo.InvariantCulture)}%)";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a <see cref="string"/> representation of a natural color
|
||||
/// </summary>
|
||||
/// <param name="color">The <see cref="Color"/> for the natural color presentation</param>
|
||||
/// <returns>A <see cref="string"/> representation of a natural color</returns>
|
||||
private static string ColorToNCol(Color color)
|
||||
{
|
||||
var (hue, whiteness, blackness) = ColorHelper.ConvertToNaturalColor(color);
|
||||
|
||||
whiteness = Math.Round(whiteness * 100);
|
||||
blackness = Math.Round(blackness * 100);
|
||||
|
||||
return $"{hue}"
|
||||
+ $", {whiteness.ToString(CultureInfo.InvariantCulture)}%"
|
||||
+ $", {blackness.ToString(CultureInfo.InvariantCulture)}%";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a <see cref="string"/> representation of a RGB color
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user