|
|
|
@ -121,7 +121,7 @@ namespace Avalonia.Controls.Primitives |
|
|
|
/// </summary>
|
|
|
|
/// <param name="hsvColor">The <see cref="HsvColor"/> to round component values for.</param>
|
|
|
|
/// <returns>A new <see cref="HsvColor"/> with rounded component values.</returns>
|
|
|
|
private HsvColor RoundComponentValues(HsvColor hsvColor) |
|
|
|
private static HsvColor RoundComponentValues(HsvColor hsvColor) |
|
|
|
{ |
|
|
|
return new HsvColor( |
|
|
|
Math.Round(hsvColor.A, 2, MidpointRounding.AwayFromZero), |
|
|
|
@ -147,7 +147,7 @@ namespace Avalonia.Controls.Primitives |
|
|
|
|
|
|
|
if (IsRoundingEnabled) |
|
|
|
{ |
|
|
|
hsvColor = RoundComponentValues(hsvColor); |
|
|
|
hsvColor = ColorSlider.RoundComponentValues(hsvColor); |
|
|
|
} |
|
|
|
|
|
|
|
// Note: Components converted into a usable range for the user
|
|
|
|
@ -272,7 +272,7 @@ namespace Avalonia.Controls.Primitives |
|
|
|
|
|
|
|
if (IsRoundingEnabled) |
|
|
|
{ |
|
|
|
hsvColor = RoundComponentValues(hsvColor); |
|
|
|
hsvColor = ColorSlider.RoundComponentValues(hsvColor); |
|
|
|
} |
|
|
|
|
|
|
|
return (rgbColor, hsvColor); |
|
|
|
|