Defines the color of a word in the cloud.
    Counts is a list of tuples in the form (word,occurences)
    The more files a word occurs in, the more red it appears in the cloud.

def assign_colors(dir_counts):
    '''Defines the color of a word in the cloud.
    Counts is a list of tuples in the form (word,occurences)
    The more files a word occurs in, the more red it appears in the cloud.'''
    frequencies = map(lambda x: x[1],dir_counts)
    words = map(lambda x: x[0],dir_counts)
    maxoccur = max(frequencies)
    minoccur = min(frequencies)
    colors = map(lambda x: colorize(x,maxoccur,minoccur),frequencies)
    color_dict = dict(zip(words,colors))
    return color_dict