开发者

How do I print / puts with color?

开发者 https://www.devze.com 2023-01-04 20:40 出处:网络
Like in the cucumber tests, there are color-coded outputs... how do开发者_如何学Go I do that?Do you mean in the context of irb?If so, I\'d suggest Wirble to colourize your output.I\'m not sure this is

Like in the cucumber tests, there are color-coded outputs... how do开发者_如何学Go I do that?


Do you mean in the context of irb? If so, I'd suggest Wirble to colourize your output.


I'm not sure this is from any gem I have, but doing thig will result in purple output.

puts "\e[0;35m this is a purple text \e[0m\n"


puts "\e[0;31m your text here \e[0m\n"
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号