src/pys5p/tol_colors.py
def tol_cset(colorset=None):
    """
    Discrete color sets for qualitative data.

    Define a namedtuple instance with the colors.
    Examples for: cset = tol_cset(<scheme>)
      - cset.red and cset[1] give the same color (in default 'bright' colorset)
      - cset._fields gives a tuple with all color names
      - list(cset) gives a list with all colors
    """
    namelist = ('bright', 'high-contrast', 'vibrant', 'muted', 'light')
    if colorset is None:
        return namelist

    if colorset not in namelist:
        print('*** Warning: requested colorset not defined,',
              f'known colorsets are {namelist}.',
              f'Using {colorset}.')

    if colorset == 'high-contrast':
        cset = namedtuple('Hcset',
                          'blue yellow red black')
        return cset('#004488', '#DDAA33', '#BB5566', '#000000')

    if colorset == 'vibrant':
        cset = namedtuple('Vcset',
                          'orange blue cyan magenta red teal grey black')
        return cset('#EE7733', '#0077BB', '#33BBEE', '#EE3377', '#CC3311',
                    '#009988', '#BBBBBB', '#000000')

    if colorset == 'muted':
        cset = namedtuple('Mcset',
                          ('rose indigo sand green cyan wine teal'
                           ' olive purple pale_grey black'))
        return cset('#CC6677', '#332288', '#DDCC77', '#117733', '#88CCEE',
                    '#882255', '#44AA99', '#999933', '#AA4499', '#DDDDDD',
                    '#000000')

    if colorset == 'light':
        cset = namedtuple('Lcset',
                          ('light_blue orange light_yellow pink light_cyan'
                           ' mint pear olive pale_grey black'))
        return cset('#77AADD', '#EE8866', '#EEDD88', '#FFAABB', '#99DDFF',
                    '#44BB99', '#BBCC33', '#AAAA00', '#DDDDDD', '#000000')

    # Default: return colorset is 'bright'
    cset = namedtuple('Bcset',
                      'blue red green yellow cyan purple grey black')
    return cset('#4477AA', '#EE6677', '#228833', '#CCBB44', '#66CCEE',
                '#AA3377', '#BBBBBB', '#000000')

    Discrete color sets for qualitative data.

    Define a namedtuple instance with the colors.
    Examples for: cset = tol_cset(<scheme>)
      - cset.red and cset[1] give the same color (in default 'bright' colorset)
      - cset._fields gives a tuple with all color names
      - list(cset) gives a list with all colors
    
Discrete color sets for qualitative data.
Define a namedtuple instance with the colors.
Examples for: cset = tol_cset()
cset.red and cset[1] give the same color (in default 'bright' colorset)
cset._fields gives a tuple with all color names
list(cset) gives a list with all colors
Discrete color sets for qualitative data . Define a namedtuple instance with the colors . Examples for : cset = tol_cset () cset . red and cset [ 1 ] give the same color ( in default ' bright ' colorset ) cset . _fields gives a tuple with all color names list ( cset ) gives a list with all colors
def tol_cset(colorset=None):
    namelist = ('bright', 'high-contrast', 'vibrant', 'muted', 'light')
    if colorset is None:
        return namelist
    if colorset not in namelist:
        print('*** Warning: requested colorset not defined,',
              f'known colorsets are {namelist}.',
              f'Using {colorset}.')
    if colorset == 'high-contrast':
        cset = namedtuple('Hcset',
                          'blue yellow red black')
        return cset('#004488', '#DDAA33', '#BB5566', '#000000')
    if colorset == 'vibrant':
        cset = namedtuple('Vcset',
                          'orange blue cyan magenta red teal grey black')
        return cset('#EE7733', '#0077BB', '#33BBEE', '#EE3377', '#CC3311',
                    '#009988', '#BBBBBB', '#000000')
    if colorset == 'muted':
        cset = namedtuple('Mcset',
                          ('rose indigo sand green cyan wine teal'
                           ' olive purple pale_grey black'))
        return cset('#CC6677', '#332288', '#DDCC77', '#117733', '#88CCEE',
                    '#882255', '#44AA99', '#999933', '#AA4499', '#DDDDDD',
                    '#000000')
    if colorset == 'light':
        cset = namedtuple('Lcset',
                          ('light_blue orange light_yellow pink light_cyan'
                           ' mint pear olive pale_grey black'))
        return cset('#77AADD', '#EE8866', '#EEDD88', '#FFAABB', '#99DDFF',
                    '#44BB99', '#BBCC33', '#AAAA00', '#DDDDDD', '#000000')
    cset = namedtuple('Bcset',
                      'blue red green yellow cyan purple grey black')
    return cset('#4477AA', '#EE6677', '#228833', '#CCBB44', '#66CCEE',
                '#AA3377', '#BBBBBB', '#000000')
def tol_cset ( colorset = None ) : namelist = ( 'bright' , 'high-contrast' , 'vibrant' , 'muted' , 'light' ) if colorset is None : return namelist if colorset not in namelist : print ( '*** Warning: requested colorset not defined,' , f'known colorsets are {namelist}.' , f'Using {colorset}.' ) if colorset == 'high-contrast' : cset = namedtuple ( 'Hcset' , 'blue yellow red black' ) return cset ( '#004488' , '#DDAA33' , '#BB5566' , '#000000' ) if colorset == 'vibrant' : cset = namedtuple ( 'Vcset' , 'orange blue cyan magenta red teal grey black' ) return cset ( '#EE7733' , '#0077BB' , '#33BBEE' , '#EE3377' , '#CC3311' , '#009988' , '#BBBBBB' , '#000000' ) if colorset == 'muted' : cset = namedtuple ( 'Mcset' , ( 'rose indigo sand green cyan wine teal' ' olive purple pale_grey black' ) ) return cset ( '#CC6677' , '#332288' , '#DDCC77' , '#117733' , '#88CCEE' , '#882255' , '#44AA99' , '#999933' , '#AA4499' , '#DDDDDD' , '#000000' ) if colorset == 'light' : cset = namedtuple ( 'Lcset' , ( 'light_blue orange light_yellow pink light_cyan' ' mint pear olive pale_grey black' ) ) return cset ( '#77AADD' , '#EE8866' , '#EEDD88' , '#FFAABB' , '#99DDFF' , '#44BB99' , '#BBCC33' , '#AAAA00' , '#DDDDDD' , '#000000' ) cset = namedtuple ( 'Bcset' , 'blue red green yellow cyan purple grey black' ) return cset ( '#4477AA' , '#EE6677' , '#228833' , '#CCBB44' , '#66CCEE' , '#AA3377' , '#BBBBBB' , '#000000' )
Discrete color sets for qualitative data.
Discrete color sets for qualitative data .
"""
    Discrete color sets for qualitative data.

    Define a namedtuple instance with the colors.
    Examples for: cset = tol_cset(<scheme>)
      - cset.red and cset[1] give the same color (in default 'bright' colorset)
      - cset._fields gives a tuple with all color names
      - list(cset) gives a list with all colors
    """ # Default: return colorset is 'bright'
colorset