String refinement for IRC message coloring