def make_style(config_string=''):
 style = Style()
 color_settings = termcolors.parse_color_setting(config_string)
 for role in termcolors.PALETTES[termcolors.NOCOLOR_PALETTE]:
  if color_settings:
   format = color_settings.get(role, {})
   style_func = termcolors.make_style(**format)
  else:
   def style_func(x):
    return x
  setattr(style, role, style_func)
 style.ERROR_OUTPUT = style.ERROR
 return style

def make_style ( config_string = '' ) : style = Style ( ) color_settings = termcolors . parse_color_setting ( config_string ) for role in termcolors . PALETTES [ termcolors . NOCOLOR_PALETTE ] : if color_settings : format = color_settings . get ( role , { } ) style_func = termcolors . make_style ( ** format ) else : def style_func ( x ) : return x setattr ( style , role , style_func ) style . ERROR_OUTPUT = style . ERROR return style
returns a function with default parameters for colorize() example: bold_red = make_style(opts= .