def filterList(all=True, extraSql=None, extraMetadata=None):
    """Return a list of filters, plot colors and orders.

    Parameters
    ----------
    all : `bool`, optional
        Include 'all' in the list of filters and as part of the colors/orders dictionaries.
        Default True.
    extraSql : str, optional
        Additional sql constraint to add to sqlconstraints returned per filter.
        Default None.
    extraMetadata : str, optional
        Substitute metadata to add to metadata strings composed per band.
        Default None.

    Returns
    -------
    list, dict, dict
        List of filter names, dictionary of colors (for plots), dictionary of orders (for display)
    """
    if all:
        filterlist = ('all', 'u', 'g', 'r', 'i', 'z', 'y')
    else:
        filterlist = ('u', 'g', 'r', 'i', 'z', 'y')
    colors = {'u': 'cyan', 'g': 'g', 'r': 'orange', 'i': 'r', 'z': 'm', 'y': 'b'}
    orders = {'u': 1, 'g': 2, 'r': 3, 'i': 4, 'z': 5, 'y': 6}
    if all:
        colors['all'] = 'k'
        orders['all'] = 0
    sqls = {}
    metadata = {}
    if extraMetadata is None:
        if extraSql is None or len(extraSql) == 0:
            md = ''
        else:
            md = '%s ' % extraSql
    else:
        md = '%s ' % extraMetadata
    for f in filterlist:
        if f == 'all':
            sqls[f] = ''
            metadata[f] = md + 'all bands'
        else:
            sqls[f] = 'filter = "%s"' % f
            metadata[f] = md + '%s band' % f
    if extraSql is not None and len(extraSql) > 0:
        for s in sqls:
            if s == 'all':
                sqls[s] = extraSql
            else:
                sqls[s] = '(%s) and (%s)' % (extraSql, sqls[s])
    return filterlist, colors, orders, sqls, metadata