def brewer_qual(name):
    """
    Qualitative palettes from the ColorBrewer project: ``'Accent'``,
    ``'Dark2'``, ``'Paired'``, ``'Pastel1'``, ``'Pastel2'``, ``'Set1'``,
    ``'Set2'``, ``'Set3'``.

    :raises ValueError: if the palette name is invalid.
    """
    colours = {
        'Accent': [
            '#7FC97F', '#BEAED4', '#FDC086', '#FFFF99', '#386CB0', '#F0027F',
            '#BF5B17', '#666666'],
        'Dark2': [
            '#1B9E77', '#D95F02', '#7570B3', '#E7298A', '#66A61E', '#E6AB02',
            '#A6761D', '#666666'],
        'Paired': [
            '#A6CEE3', '#1F78B4', '#B2DF8A', '#33A02C', '#FB9A99', '#E31A1C',
            '#FDBF6F', '#FF7F00', '#CAB2D6', '#6A3D9A', '#FFFF99', '#B15928'],
        'Pastel1': [
            '#FBB4AE', '#B3CDE3', '#CCEBC5', '#DECBE4', '#FED9A6', '#FFFFCC',
            '#E5D8BD', '#FDDAEC', '#F2F2F2'],
        'Pastel2': [
            '#B3E2CD', '#FDCDAC', '#CBD5E8', '#F4CAE4', '#E6F5C9', '#FFF2AE',
            '#F1E2CC', '#CCCCCC'],
        'Set1': [
            '#E41A1C', '#377EB8', '#4DAF4A', '#984EA3', '#FF7F00', '#FFFF33',
            '#A65628', '#F781BF', '#999999'],
        'Set2': [
            '#66C2A5', '#FC8D62', '#8DA0CB', '#E78AC3', '#A6D854', '#FFD92F',
            '#E5C494', '#B3B3B3'],
        'Set3': [
            '#8DD3C7', '#FFFFB3', '#BEBADA', '#FB8072', '#80B1D3', '#FDB462',
            '#B3DE69', '#FCCDE5', '#D9D9D9', '#BC80BD', '#CCEBC5', '#FFED6F'],
    }
    if name not in colours:
        raise ValueError("invalid palette: {}".format(name))
    else:
        return colours[name]