<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update_color(string, name, style='normal', when='auto'):
 """ Replace the existing line with the given colored string. """

    clear()
    write_color(string, name, style, when)