A Kiwi package for colorizing terminal output using ANSI escape codes.
zest install fuseraft/colorizeThen in your script:
include ".zest/load.kiwi"
All named color and style functions print the colored string and return it, so they work both as standalone statements and inside expressions.
include ".zest/load.kiwi"
for msg in ["error", "warning", "ok"] do
colorize::red(msg) when msg == "error"
colorize::amber(msg) when msg == "warning"
colorize::green(msg) when msg == "ok"
end
Prints and returns msg in red.
colorize::red("something went wrong")
Prints and returns msg in green.
colorize::green("all systems go")
Prints and returns msg in amber (yellow).
colorize::amber("proceed with caution")
Prints and returns msg in blue.
colorize::blue("info: starting up")
Prints and returns msg in magenta.
colorize::magenta("debug output")
Prints and returns msg in cyan.
colorize::cyan("→ hint")
Prints and returns msg in white.
colorize::white("plain terminal white")
Prints and returns msg in bold.
colorize::bold("Section Header")
Prints and returns msg in dim style.
colorize::dim("(optional)")
Prints and returns msg in italic.
colorize::italic("see docs for details")
Prints and returns msg with an underline.
colorize::underline("https://example.com")
Returns the ANSI-escaped string without printing. Use this to build colored strings for embedding in larger output.
label = colorize::str("WARN", "33")
println "[${label}] disk usage above 90%"
Low-level helper — same as str. Wraps msg with the given ANSI SGR code and appends a reset.
colorize::paint("custom", "35") # magenta via raw code
Appends a reset escape sequence after msg (no print). Useful when chaining raw ANSI codes manually.
line = "\u001b[1m" + colorize::reset("bold then normal")
MIT