Tag: ansi colors

更好的ruby终端着色库

有很多着色库:彩色,term-ansicolor。 但有没有可以做到这一点: puts “#{‘hello’.red} world!”.bold 和world! 应该是大胆的。 为了说清楚,我想得到这个: “\e[1m\e[31mhello\e[0m\e[1m world!\e[0m” 甚至更好(更短): “\e[1;31mhello\e[0;1m world!\e[0m” 而不是这个: “\e[1m\e[31mhello\e[0m world!\e[0m”