using RGB.NET.Core; using RGB.NET.Presets.Textures.Gradients; namespace RGB.NET.Presets.Textures; /// /// /// /// Represents a abstract texture containing a color-gradient. /// public abstract class AbstractGradientTexture : AbstractBindable, ITexture { #region Properties & Fields /// /// Gets the gradient used to generate this texture. /// public IGradient Gradient { get; } /// public Size Size { get; } /// public Color this[in Point point] => GetColor(point); /// public Color this[in Rectangle rectangle] => GetColor(rectangle.Center); #endregion #region Constructors /// /// Initializes a new instance of the class. /// /// The size of the texture. /// The gradient used to generate this texture. protected AbstractGradientTexture(Size size, IGradient gradient) { this.Size = size; this.Gradient = gradient; } #endregion #region Methods /// /// Gets the color at the specified location of the texture. /// /// The location to get the color from. /// The color at the specified location. protected abstract Color GetColor(in Point point); #endregion }