#!ruby -p $_.gsub!(/^ +|(.)\1*/){($1?"\x1b[#{".1/(*1)\x00,"[$&[0]%9]}m":"")+" "*$&.size}[/$/]="\x1b[49m"
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page