use crate::*; /// A cell that takes up 3 rows on its own, /// but stacks, giving (N+1)*2 rows per N cells. pub struct Phat { pub width: u16, pub height: u16, pub content: T, pub colors: [Color;4], } impl Phat { pub const LO: &'static str = "▄"; pub const HI: &'static str = "▀"; /// A phat line pub fn lo (fg: Color, bg: Color) -> impl Render { Fixed::y(1, Tui::fg_bg(fg, bg, RepeatH(Self::LO))) } /// A phat line pub fn hi (fg: Color, bg: Color) -> impl Render { Fixed::y(1, Tui::fg_bg(fg, bg, RepeatH(Self::HI))) } } impl> Content for Phat { fn content (&self) -> Option + '_> { let [fg, bg, hi, lo] = self.colors; let top = Fixed::y(1, Self::lo(bg, hi)); let low = Fixed::y(1, Self::hi(bg, lo)); let content = Tui::fg_bg(fg, bg, &self.content); Some(Min::xy( self.width, self.height, Bsp::s(top, Bsp::n(low, Fill::xy(content))) )) } }