mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
// 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
|
|
{
|
|
/// <summary>
|
|
/// A struct that defines a single color stop.
|
|
/// </summary>
|
|
[DebuggerDisplay("ColorStop({Ratio} -> {Color}")]
|
|
public readonly struct ColorStop
|
|
{
|
|
/// <summary>
|
|
/// Initializes a new instance of the <see cref="ColorStop" /> struct.
|
|
/// </summary>
|
|
/// <param name="ratio">Where should it be? 0 is at the start, 1 at the end of the Gradient.</param>
|
|
/// <param name="color">What color should be used at that point?</param>
|
|
public ColorStop(float ratio, in Color color)
|
|
{
|
|
this.Ratio = ratio;
|
|
this.Color = color;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Gets the point along the defined gradient axis.
|
|
/// </summary>
|
|
public float Ratio { get; }
|
|
|
|
/// <summary>
|
|
/// Gets the color to be used.
|
|
/// </summary>
|
|
public Color Color { get; }
|
|
}
|
|
}
|