def get_color(colour, return_formatted=True):
 colour = colour.lower()
 if (colour not in IRC_COLOUR_DICT):
  raise KeyError("The colour '{}' is not in the list of available colours.".format(colour))
 if (colour == 'random'):
  rand = randint(0, 15)
  if (rand < 10):
   rand = ('0' + str(rand))
  rand = str(rand)
  if return_formatted:
   return (get_format('colour') + rand)
  return rand
 if return_formatted:
  return (get_format('colour') + IRC_COLOUR_DICT[colour])
 return IRC_COLOUR_DICT[colour]

def get_color ( colour , return_formatted = True ) : colour = colour . lower ( ) if ( colour not in IRC_COLOUR_DICT ) : raise KeyError ( "The colour '{}' is not in the list of available colours." . format ( colour ) ) if ( colour == 'random' ) : rand = randint ( 0 , 15 ) if ( rand < 10 ) : rand = ( '0' + str ( rand ) ) rand = str ( rand ) if return_formatted : return ( get_format ( 'colour' ) + rand ) return rand if return_formatted : return ( get_format ( 'colour' ) + IRC_COLOUR_DICT [ colour ] ) return IRC_COLOUR_DICT [ colour ]
gets a color by looking up its name or initializing with name+data .