def colour_text(text, fg=None, bg=None):
    """Given some text and fore/back colours, return a coloured text string."""
    if fg is None:
        return text
    else:
        colour = '{0},{1}'.format(fg, bg) if bg is not None else fg
        return "\x03{0}{1}\x03".format(colour, text)