SolidFill.cs 821 B

123456789101112131415161718192021222324
  1. namespace Terminal.Gui;
  2. /// <summary>
  3. /// <see cref="IFill"/> implementation that uses a solid color for all points
  4. /// </summary>
  5. public class SolidFill : IFill
  6. {
  7. private readonly Color _color;
  8. /// <summary>
  9. /// Creates a new instance of the <see cref="SolidFill"/> class which will return
  10. /// the provided <paramref name="color"/> regardless of which point is requested.
  11. /// </summary>
  12. /// <param name="color"></param>
  13. public SolidFill (Color color) { _color = color; }
  14. /// <summary>
  15. /// Returns the color this instance was constructed with regardless of
  16. /// which <paramref name="point"/> is being colored.
  17. /// </summary>
  18. /// <param name="point"></param>
  19. /// <returns></returns>
  20. public Color GetColor (Point point) { return _color; }
  21. }