Example #1
0
 public bool Equals(Color other)
 {
     return Red.Equals(other.Red) && Green.Equals(other.Green) && Blue.Equals(other.Blue) && Alpha.Equals(other.Alpha);
 }
Example #2
0
 // Mixes the current color with a white that has the same alpha.
 public static Color Lightened(this Color _, double f)
 {
     var white = new Color(1, 1, 1, _.Alpha);
     return _.Mixed(white, f);
 }
Example #3
0
 // 0: current color, 1: other color.
 public static Color Mixed(this Color _, Color other, double f)
 {
     return new Color(
         interpolate(_.Red, other.Red, f),
         interpolate(_.Green, other.Green, f),
         interpolate(_.Blue, other.Blue, f),
         interpolate(_.Alpha, other.Alpha, f))
     ;
 }
Example #4
0
 // Mixes the current color with a black that has the same alpha.
 public static Color Darkened(this Color _, double f)
 {
     var black = new Color(0, 0, 0, _.Alpha);
     return _.Mixed(black, f);
 }