标签: colors terminal julia
是否有任何功能可让您在终端中对背景进行彩色打印?
我在文档中找到了函数print_with_color,但它只为文本着色。我是否必须将ANSI转义序列添加到字符串中,还是有另一种方式?
答案 0 :(得分:3)
Crayons可以做到这一点。它为print_with_color添加了一种方法:
print_with_color
julia> using Crayons julia> print_with_color(Crayon(background = :red), "hello") hello
还有其他一些语法可以用来做同样的事情。普通print和println也会过载,但它们的输出颜色有多少(两者都给出了整条线的背景)。
print
println
或者,有AnsiColor。