Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate proper level when forcing color #72

Merged

Conversation

TooTallNate
Copy link
Contributor

@TooTallNate TooTallNate commented Dec 28, 2017

Before, the level would be 1 when forcing color when the stream is not a TTY.

$ FORCE_COLOR=1 node -p "require('supports-color').stdout" | cat
{ level: 1, hasBasic: true, has256: false, has16m: false }`

Now, the proper level is calculated based on the environment, even when the stream is not a TTY.

$ FORCE_COLOR=1 node -p "require('supports-color').stdout" | cat
{ level: 3, hasBasic: true, has256: true, has16m: true }

Before, the level would be 1 when forcing color when the stream
is not a TTY.

```
$ FORCE_COLOR=1 node -p "require('supports-color').stdout" | cat
{ level: 1, hasBasic: true, has256: false, has16m: false }`
```

Now, the proper level is calculated based on the environment, even
when the stream is not a TTY.

```
$ FORCE_COLOR=1 node -p "require('supports-color').stdout" | cat
{ level: 3, hasBasic: true, has256: true, has16m: true }
```
@sindresorhus sindresorhus merged commit b16e9a4 into chalk:master Feb 11, 2018
@sindresorhus
Copy link
Member

Thanks :)

@TooTallNate TooTallNate deleted the update/calculate-level-with-force branch February 11, 2018 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants