def paint
import cli@0.2.0.0/cli.bend as Cliimport Base
45def paint(on: Bool, styles: List<&2, Style>, text: String) -> String:
46 match on styles:
47 case False{} _:
48 text
49 case True{} Nil{}:
50 text
51 case True{} h <> t:
52 String.append("\u{1B}[",
53 String.append(style_codes(h <> t),
54 String.append("m", String.append(text, "\u{1B}[0m"))))