terminal colours by leonid

#!ruby -p
gsub(/^ +|(.|\b)\1*/){[$1&&"\x1b[%dm"%"._/(*1)_,"["#$1_"[0]%9],"  "*$&.size]}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page