def char_diff(self, old, new):
def color_transition(old_type, new_type):<EOL><INDENT>new_color = termcolor.colored("<STR_LIT>", None, "<STR_LIT>" if new_type ==<EOL>"<STR_LIT:->" else "<STR_LIT>" if new_type == "<STR_LIT:+>" else None)<EOL>return "<STR_LIT>".format(termcolor.RESET, new_color[:-len(termcolor.RESET)])<EOL><DEDENT>return self._char_diff(old, new, color_transition)<EOL>
Return color-coded character-based diff between `old` and `new`.