def get_termcolor_opts(dtype, _larch=None):
    """ get color options suitable for passing to
    larch's writer.write() for color output

    first argument should be string of
    'text', 'text2', 'error', 'comment'"""
    out = {'color': None}
    display = _larch.symtable._sys.display
    if display.use_color:
        out = getattr(display.colors, dtype, out)
    return out
