Remove ansi color space
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
This commit is contained in:
parent
b0e338a3a7
commit
9f6b90fdc2
4 changed files with 1 additions and 21 deletions
17
index.d.ts
vendored
17
index.d.ts
vendored
|
|
@ -183,14 +183,6 @@ export interface ChalkInstance extends ChalkFunction {
|
||||||
*/
|
*/
|
||||||
hex: (color: string) => this;
|
hex: (color: string) => this;
|
||||||
|
|
||||||
/**
|
|
||||||
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set text color.
|
|
||||||
|
|
||||||
30 <= code && code < 38 || 90 <= code && code < 98
|
|
||||||
For example, 31 for red, 91 for redBright.
|
|
||||||
*/
|
|
||||||
ansi: (code: number) => this;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
|
||||||
*/
|
*/
|
||||||
|
|
@ -215,15 +207,6 @@ export interface ChalkInstance extends ChalkFunction {
|
||||||
*/
|
*/
|
||||||
bgHex: (color: string) => this;
|
bgHex: (color: string) => this;
|
||||||
|
|
||||||
/**
|
|
||||||
Use a [Select/Set Graphic Rendition](https://en.wikipedia.org/wiki/ANSI_escape_code#SGR_parameters) (SGR) [color code number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) to set background color.
|
|
||||||
|
|
||||||
30 <= code && code < 38 || 90 <= code && code < 98
|
|
||||||
For example, 31 for red, 91 for redBright.
|
|
||||||
Use the foreground code, not the background code (for example, not 41, nor 101).
|
|
||||||
*/
|
|
||||||
bgAnsi: (code: number) => this;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
|
Use a [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set background color.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -43,11 +43,9 @@ expectType<string>(chalk`Works with numbers {bold.red ${1}}`);
|
||||||
// -- Color methods --
|
// -- Color methods --
|
||||||
expectAssignable<colorReturn>(chalk.rgb(0, 0, 0));
|
expectAssignable<colorReturn>(chalk.rgb(0, 0, 0));
|
||||||
expectAssignable<colorReturn>(chalk.hex('#DEADED'));
|
expectAssignable<colorReturn>(chalk.hex('#DEADED'));
|
||||||
expectAssignable<colorReturn>(chalk.ansi(30));
|
|
||||||
expectAssignable<colorReturn>(chalk.ansi256(0));
|
expectAssignable<colorReturn>(chalk.ansi256(0));
|
||||||
expectAssignable<colorReturn>(chalk.bgRgb(0, 0, 0));
|
expectAssignable<colorReturn>(chalk.bgRgb(0, 0, 0));
|
||||||
expectAssignable<colorReturn>(chalk.bgHex('#DEADED'));
|
expectAssignable<colorReturn>(chalk.bgHex('#DEADED'));
|
||||||
expectAssignable<colorReturn>(chalk.bgAnsi(30));
|
|
||||||
expectAssignable<colorReturn>(chalk.bgAnsi256(0));
|
expectAssignable<colorReturn>(chalk.bgAnsi256(0));
|
||||||
|
|
||||||
// -- Modifiers --
|
// -- Modifiers --
|
||||||
|
|
|
||||||
|
|
@ -298,7 +298,6 @@ The following color models can be used:
|
||||||
|
|
||||||
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
|
- [`rgb`](https://en.wikipedia.org/wiki/RGB_color_model) - Example: `chalk.rgb(255, 136, 0).bold('Orange!')`
|
||||||
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
- [`hex`](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) - Example: `chalk.hex('#FF8800').bold('Orange!')`
|
||||||
- [`ansi`](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4_bit) - Example: `chalk.ansi(31).bgAnsi(93)('red on yellowBright')`
|
|
||||||
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
- [`ansi256`](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) - Example: `chalk.bgAnsi256(194)('Honeydew, more or less')`
|
||||||
|
|
||||||
## Browser support
|
## Browser support
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ const getModelAnsi = (model, level, type, ...arguments_) => {
|
||||||
return ansiStyles[type][model](...arguments_);
|
return ansiStyles[type][model](...arguments_);
|
||||||
};
|
};
|
||||||
|
|
||||||
const usedModels = ['rgb', 'hex', 'ansi256', 'ansi'];
|
const usedModels = ['rgb', 'hex', 'ansi256'];
|
||||||
|
|
||||||
for (const model of usedModels) {
|
for (const model of usedModels) {
|
||||||
styles[model] = {
|
styles[model] = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue