def color_mapping(sample_map, header, group_column, color_column=None):
    group_colors = OrderedDict()
    group_gather = gather_categories(sample_map, header, [group_column])
    if color_column is not None:
        color_gather = gather_categories(sample_map, header, [color_column])
        for group in group_gather:
            for color in color_gather:
                if group_gather[group].sids.intersection(color_gather[color].sids):
                    group_colors[group] = color
    else:
        bcolors = itertools.cycle(Set3_12.hex_colors)
        for group in group_gather:
            group_colors[group] = bcolors.next()
    return group_colors