(string, color='', graphic='')
Change text color for the Linux terminal.

    Args:
        string (str): String to colorify
        color (str): Color to colorify the string in the following list:
            black, red, green, yellow, blue, purple, cyan, gr[ae]y
        graphic (str): Graphic to append to the beginning of the line
Change text color for the Linux terminal.
Change text color for the Linux terminal .
def color(string, color='', graphic=''):
    """
    Change text color for the Linux terminal.

    Args:
        string (str): String to colorify
        color (str): Color to colorify the string in the following list:
            black, red, green, yellow, blue, purple, cyan, gr[ae]y
        graphic (str): Graphic to append to the beginning of the line
    """


    if not color:
        if string.startswith("[!] "):
            color = 'red'
        elif string.startswith("[+] "):
            color = 'green'
        elif string.startswith("[*] "):
            color = 'blue'
        else:
            color = 'normal'

    if color not in colors:
        print colors['red'] + 'Color not found: {}'.format(color) + colors['normal']
        return

    if color:
        return colors[color] + graphic + string + colors['normal']
    else:
        return string + colors['normal']
def color ( string , color = '' , graphic = '' ) : if not color : if string . startswith ( "[!] " ) : color = 'red' elif string . startswith ( "[+] " ) : color = 'green' elif string . startswith ( "[*] " ) : color = 'blue' else : color = 'normal' if color not in colors : print colors [ 'red' ] + 'Color not found: {}' . format ( color ) + colors [ 'normal' ] return if color : return colors [ color ] + graphic + string + colors [ 'normal' ] else : return string + colors [ 'normal' ]