There are plenty of coloring libraries: colored, term-ansicolor. But is there any which can do this:
puts "#{'hello'.red} world!".bold And world! should be bold.
To make it clear, I want to get this:
"\e[1m\e[31mhello\e[0m\e[1m world!\e[0m" or better even this (just shorter):
"\e[1;31mhello\e[0;1m world!\e[0m" instead of this:
"\e[1m\e[31mhello\e[0m world!\e[0m"
<strong><span style="color:red">hello</span> world!</strong>? I want same thing in bash and I was just trying to know if there is already such library and if not I'll write my own."red #{"green".green} red".red?helloto be red (and bold as it is part of string). For your example html equivalent is<span style="color:red">red <span style="color:green">green</span> red</span>.