This commit is contained in:
LitoMore 2022-10-04 20:29:26 +08:00
parent 355d134ca0
commit 6444e365c0
No known key found for this signature in database
GPG key ID: B8653F9344667340

View file

@ -203,12 +203,15 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=
### modifiers, foregroundColors, backgroundColors, and colors
All supported style strings are exposed for convenience. `colors` is the combination of `foregroundColors` and `backgroundColors`.
All supported style strings are exposed as an array of strings for convenience. `colors` is the combination of `foregroundColors` and `backgroundColors`.
This is useful when checking if a style string is supported:
```js
import {foregroundColors} from 'chalk';
import {modifiers, foregroundColors} from 'chalk';
console.log(modifiers.includes('bold'));
//=> true
console.log(foregroundColors.includes('pink'));
//=> false