join elements of code_list in a string, separated by ';', format string '\x1b[%sm' with it, append text to the result if exists,
return '%s%s' % ( ( '\x1b[%sm' % ';' . join ( code_list ) ) , text or '' )