diff --git a/readme.md b/readme.md index 2f41876..6caba7e 100644 --- a/readme.md +++ b/readme.md @@ -201,6 +201,10 @@ Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color= `chalkStderr` contains a separate instance configured with color support detected for `stderr` stream instead of `stdout`. Override rules from `supportsColor` apply to this too. `supportsColorStderr` is exposed for convenience. +### modifiers, foregroundColors, backgroundColors and colors + +All supported style strings are exposed for convenience. `colors` is the combination of `foregroundColors` and `backgroundColors`. + ## Styles ### Modifiers diff --git a/source/index.d.ts b/source/index.d.ts index eceb90e..b0acc0f 100644 --- a/source/index.d.ts +++ b/source/index.d.ts @@ -284,8 +284,9 @@ export { // } from '#supports-color'; } from './vendor/supports-color/index.js'; -export const modifiers: Modifiers[]; -export const foregroundColors: ForegroundColor[]; -export const backgroundColors: BackgroundColor[]; +export const modifiers: readonly Modifiers[]; +export const foregroundColors: readonly ForegroundColor[]; +export const backgroundColors: readonly BackgroundColor[]; +export const colors: readonly Color[]; export default chalk; diff --git a/source/index.js b/source/index.js index e78bea7..340eb10 100644 --- a/source/index.js +++ b/source/index.js @@ -212,5 +212,6 @@ export { export const modifiers = Object.keys(ansiStyles.modifier); export const foregroundColors = Object.keys(ansiStyles.color); export const backgroundColors = Object.keys(ansiStyles.bgColor); +export const colors = [...foregroundColors, ...backgroundColors]; export default chalk;