Browse Source

Make alpha the first parameter in the constructor matching Color

pull/7724/head
robloo 4 years ago
parent
commit
b67c086f71
  1. 6
      src/Avalonia.Visuals/Media/HsvColor.cs

6
src/Avalonia.Visuals/Media/HsvColor.cs

@ -36,15 +36,15 @@ namespace Avalonia.Media
/// <summary>
/// Initializes a new instance of the <see cref="HsvColor"/> struct.
/// </summary>
/// <param name="alpha">The Alpha (transparency) channel value in the range from 0..1.</param>
/// <param name="hue">The Hue channel value in the range from 0..360.</param>
/// <param name="saturation">The Saturation channel value in the range from 0..1.</param>
/// <param name="value">The Value channel value in the range from 0..1.</param>
/// <param name="alpha">The Alpha (transparency) channel value in the range from 0..1.</param>
public HsvColor(
double alpha,
double hue,
double saturation,
double value,
double alpha)
double value)
{
A = MathUtilities.Clamp((double.IsNaN(alpha) ? 1 : alpha), 0, 1); // Default to no transparency
H = MathUtilities.Clamp((double.IsNaN(hue) ? 0 : hue), 0, 360);

Loading…
Cancel
Save