Add a few colorful escapes

This commit is contained in:
Bruce Hill 2025-03-11 00:45:52 -04:00
parent 8885d1fdcb
commit e095c7fb64

View File

@ -11,6 +11,9 @@ lang Colorful:
text = text:replace_all({$/@/="@(at)", $/(/="@(lparen)", $/)/="@(rparen)"})
return Colorful.without_escaping(text)
convert(i:Int -> Colorful): return Colorful.without_escaping("$i")
convert(n:Num -> Colorful): return Colorful.without_escaping("$n")
func for_terminal(c:Colorful -> Text):
return CSI ++ "m" ++ _for_terminal(c, _TermState())