def get_color(color, configuration, palettes):
    """Find the colour in the palettes or configuration. If it is not a
palette-enabled colour, just pass through"""
    if '.' not in color:
        return color
    palette, color_name = color.split('.')
    if palette in ['note', 'link', 'graph', 'tag']:
        raise Exception(
            f"Palette name can't be one of the top level configuration names (it is {palette})"
            )
    if palette in configuration.keys():
        palette_dict = configuration[palette]
    elif palette in palettes.keys():
        palette_dict = palettes[palette]
    else:
        raise Exception(f'Palette {palette} is not available')
    if color_name not in palette_dict.keys():
        raise Exception(
            f'Color {color_name} is not available in palette {palette}')
    return palette_dict[color_name]
