// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using System.Diagnostics;
using SixLabors.ImageSharp.PixelFormats;
namespace SixLabors.ImageSharp.Processing
{
///
/// A struct that defines a single color stop.
///
/// The pixel format.
[DebuggerDisplay("ColorStop({Ratio} -> {Color}")]
public struct ColorStop
where TPixel : struct, IPixel
{
///
/// Initializes a new instance of the struct.
///
/// Where should it be? 0 is at the start, 1 at the end of the Gradient.
/// What color should be used at that point?
public ColorStop(float ratio, TPixel color)
{
this.Ratio = ratio;
this.Color = color;
}
///
/// Gets the point along the defined gradient axis.
///
public float Ratio { get; }
///
/// Gets the color to be used.
///
public TPixel Color { get; }
}
}