Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Support bold (or underline) text with no color specification #157

Open
dandavison opened this issue Apr 25, 2016 · 0 comments
Open

Support bold (or underline) text with no color specification #157

dandavison opened this issue Apr 25, 2016 · 0 comments

Comments

@dandavison
Copy link

It would be useful to be able to specify bold text without specifying a color (so the default foreground color will be used which will be compatible with the current terminal color scheme). A quick version based on how clint does colors:

def default_color(s, always=False, bold=False):
    if bold and (always or sys.stdout.isatty()):
        return '{on}{string}{off}'.format(
            on=getattr(colorama.Style, 'BRIGHT'),
            string=s,
            off=getattr(colorama.Style, 'NORMAL'))
    else:
        return s
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant