示例#1
0
 /// <summary>Initializes a new instance of the <see cref="T:LukeSw.Drawing.ColorHsv"/> structure
 /// from the specified double values.</summary>
 /// <param name="alpha">The alpha component value. Valid values are 0 through 1.</param>
 /// <param name="hue">The hue component value. Valid values are 0 through 360.</param>
 /// <param name="saturation">The saturation component value. Valid values are 0 through 1.</param>
 /// <param name="value">The value component value. Valid values are 0 through 1.</param>
 public ColorHsv(double alpha, double hue, double saturation, double value)
 {
     ColorRgb.Checkdouble(alpha, "alpha");
     ColorRgb.Checkdouble(hue, "hue", 0.0, 360.0);
     if (hue == 360.0)
     {
         hue = 0.0;
     }
     ColorRgb.Checkdouble(saturation, "saturation");
     ColorRgb.Checkdouble(value, "value");
     this.A = alpha;
     this.H = hue;
     this.S = saturation;
     this.V = value;
 }
示例#2
0
 /// <summary>Initializes a new instance of the <see cref="T:LukeSw.Drawing.ColorHsl"/> structure
 /// from the specified double values.</summary>
 /// <param name="alpha">The alpha component value. Valid values are 0 through 1.</param>
 /// <param name="hue">The hue component value. Valid values are 0 through 360.</param>
 /// <param name="saturation">The saturation component value. Valid values are 0 through 1.</param>
 /// <param name="lightness">The lightness component value. Valid values are 0 through 1.</param>
 public ColorHsl(double alpha, double hue, double saturation, double lightness)
 {
     ColorRgb.Checkdouble(alpha, "alpha");
     ColorRgb.Checkdouble(hue, "hue", 0.0, 360.0);
     if (hue == 360.0)
     {
         hue = 0.0;
     }
     ColorRgb.Checkdouble(saturation, "saturation");
     ColorRgb.Checkdouble(lightness, "lightness");
     this.A = alpha;
     this.H = hue;
     this.S = saturation;
     this.L = lightness;
 }