wip: big flat pt.9: down to 141, looking good!

This commit is contained in:
🪞👃🪞 2024-12-30 20:43:22 +01:00
parent e958b4a2d2
commit d01aa7481b
7 changed files with 39 additions and 12 deletions

View file

@ -1,23 +1,25 @@
use crate::*;
impl Tui {
pub(crate) fn fg <W: Render<Tui>> (color: Color, w: W) -> Foreground<W> {
pub trait TuiStyle {
fn fg <W: Render<Tui>> (color: Color, w: W) -> Foreground<W> {
Foreground(color, w)
}
pub(crate) fn bg <W: Render<Tui>> (color: Color, w: W) -> Background<W> {
fn bg <W: Render<Tui>> (color: Color, w: W) -> Background<W> {
Background(color, w)
}
pub(crate) fn fg_bg <W: Render<Tui>> (fg: Color, bg: Color, w: W) -> Background<Foreground<W>> {
fn fg_bg <W: Render<Tui>> (fg: Color, bg: Color, w: W) -> Background<Foreground<W>> {
Background(bg, Foreground(fg, w))
}
pub(crate) fn bold <W: Render<Tui>> (on: bool, w: W) -> Bold<W> {
fn bold <W: Render<Tui>> (on: bool, w: W) -> Bold<W> {
Bold(on, w)
}
pub(crate) fn border <W: Render<Tui>, S: BorderStyle> (style: S, w: W) -> Bordered<S, W> {
fn border <W: Render<Tui>, S: BorderStyle> (style: S, w: W) -> Bordered<S, W> {
Bordered(style, w)
}
}
impl TuiStyle for Tui {}
pub struct Bold<W: Render<Tui>>(pub bool, W);
impl<W: Render<Tui>> Render<Tui> for Bold<W> {