protected PaintGradientStop[] GetRenderStops(IGradient gradient) { var stops = gradient.GetStops(); if (stops.Count == 1) { return(new[] { new PaintGradientStop(0, stops[0].Color), new PaintGradientStop(1, stops[0].Color) }); } return(stops .OrderBy(x => x.RenderOffset) .Select(x => new PaintGradientStop(x.RenderOffset, x.Color)) .ToArray()); }
protected IGradientStop[] GetRenderStops(IGradient gradient) { var stops = gradient.GetStops(); if (stops.Count == 1) { return(new[] { new GradientStop { RenderOffset = 0, Color = stops[0].Color }, new GradientStop { RenderOffset = 1, Color = stops[0].Color } }); } return(stops.OrderBy(x => x.RenderOffset).ToArray()); }