FillPair.cs 657 B

1234567891011121314151617181920212223242526272829
  1. 
  2. using Terminal.Gui.Drawing;
  3. namespace Terminal.Gui;
  4. /// <summary>
  5. /// Describes a pair of <see cref="IFill"/> which cooperate in creating
  6. /// <see cref="Attribute"/>. One gives foreground color while other gives background.
  7. /// </summary>
  8. public class FillPair
  9. {
  10. public FillPair (GradientFill fore, SolidFill back)
  11. {
  12. Foreground = fore;
  13. Background = back;
  14. }
  15. IFill Foreground { get; set; }
  16. IFill Background { get; set; }
  17. internal Attribute? GetAttribute (Point point)
  18. {
  19. return new Attribute (
  20. Foreground.GetColor (point),
  21. Background.GetColor (point)
  22. );
  23. }
  24. }