24 writes to Colors
System.Drawing.Common.Tests (24)
System\Drawing\Drawing2D\ColorBlendTests.cs (2)
41ColorBlend blend = new() { Colors = null }; 44blend.Colors = new Color[10];
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (13)
261Colors = [Color.Red, Color.PeachPuff, Color.PowderBlue], 378Colors = [Color.Red, Color.PeachPuff, Color.PowderBlue], 394Colors = [Color.Wheat, Color.Yellow], 400Colors = [Color.Red, Color.PeachPuff, Color.PowderBlue], 419Assert.Throws<NullReferenceException>(() => brush.InterpolationColors = new ColorBlend { Colors = null }); 430() => brush.InterpolationColors = new ColorBlend { Colors = new Color[colorsLength] }); 437Assert.Throws<ArgumentException>(() => brush.InterpolationColors = new ColorBlend { Colors = new Color[2], Positions = null }); 449Colors = new Color[2], 462Colors = new Color[positions.Length], 474Colors = [Color.Red, Color.PeachPuff, Color.PowderBlue], 483Colors = new Color[2], 495Colors = [Color.Red, Color.PeachPuff, Color.PowderBlue], 514Colors = [Color.Red, Color.PeachPuff, Color.PowderBlue],
System\Drawing\Drawing2D\PathGradientBrushTests.cs (9)
533brush.InterpolationColors = new ColorBlend() { Colors = expectedColors, Positions = expectedPositions }; 537brush.InterpolationColors = new ColorBlend() { Colors = sameColors, Positions = expectedPositions }; 551brush.InterpolationColors.Colors = colors; 583brush.InterpolationColors = new ColorBlend() { Colors = null, Positions = null }); 586brush.InterpolationColors = new ColorBlend() { Colors = null, Positions = new float[2] }); 594brush.InterpolationColors = new ColorBlend() { Colors = new Color[1], Positions = null }); 609brush.InterpolationColors = new ColorBlend() { Colors = [], Positions = [] }); 617brush.InterpolationColors = new ColorBlend() { Colors = new Color[1], Positions = new float[2] }); 625brush.InterpolationColors = new ColorBlend() { Colors = new Color[2], Positions = new float[1] });
21 references to Colors
System.Drawing.Common.Tests (21)
System\Drawing\Drawing2D\ColorBlendTests.cs (4)
12Assert.Equal(new Color[1], blend.Colors); 22Assert.Equal(new Color[count], blend.Colors); 42Assert.Null(blend.Colors); 45Assert.Equal(new Color[10], blend.Colors);
System\Drawing\Drawing2D\LinearGradientBrushTests.cs (8)
383Assert.Equal(blend.Colors.Select(c => Color.FromArgb(c.ToArgb())), brush.InterpolationColors.Colors); 404Assert.Equal(blend.Colors.Select(c => Color.FromArgb(c.ToArgb())), brush.InterpolationColors.Colors); 502brush.InterpolationColors.Colors.Should().HaveCount(1); 504brush.InterpolationColors.Colors[0].IsEmpty.Should().BeTrue(); 526brush.InterpolationColors.Colors.Should().HaveCount(1); 528brush.InterpolationColors.Colors[0].IsEmpty.Should().BeTrue();
System\Drawing\Drawing2D\PathGradientBrushTests.cs (9)
534Assert.Equal(expectedColors, brush.InterpolationColors.Colors); 538Assert.Equal(sameColors, brush.InterpolationColors.Colors); 549brush.InterpolationColors.Colors.ToList().AddRange(colors); 550Assert.Equal(defaultColors, brush.InterpolationColors.Colors); 552Assert.Equal(defaultColors, brush.InterpolationColors.Colors); 553brush.InterpolationColors.Colors[0] = Color.Pink; 554Assert.NotEqual(Color.Pink, brush.InterpolationColors.Colors[0]); 555Assert.Equal(defaultColors, brush.InterpolationColors.Colors); 946Assert.Equal(new Color[] { Color.Empty }, brush.InterpolationColors.Colors);