SolidFill.cs 834 B

12345678910111213141516171819202122232425262728293031
  1. namespace Terminal.Gui.Drawing;
  2. /// <summary>
  3. /// <see cref="IFill"/> implementation that uses a solid color for all points
  4. /// </summary>
  5. public class SolidFill : IFill
  6. {
  7. 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)
  14. {
  15. _color = color;
  16. }
  17. /// <summary>
  18. /// Returns the color this instance was constructed with regardless of
  19. /// which <paramref name="point"/> is being colored.
  20. /// </summary>
  21. /// <param name="point"></param>
  22. /// <returns></returns>
  23. public Color GetColor (Point point)
  24. {
  25. return _color;
  26. }
  27. }