using Avalonia.Utilities; namespace Avalonia.Media.Immutable { /// /// Describes the location and color of a transition point in a gradient. /// public class ImmutableGradientStop : IGradientStop { public ImmutableGradientStop(double offset, Color color) { if (MathUtilities.IsZero(offset)) { offset = 0; } Offset = (offset < 0) ? 0 : (offset > 1) ? 1 : offset; Color = color; } /// public double Offset { get; } /// public Color Color { get; } } }