@visulima/colorize 2.0.0-alpha.1 → 2.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +169 -0
- package/LICENSE.md +1 -1
- package/README.md +32 -30
- package/dist/gradient.cjs +3 -60
- package/dist/gradient.d.cts +21 -12
- package/dist/gradient.d.mts +21 -12
- package/dist/gradient.d.ts +21 -12
- package/dist/gradient.mjs +3 -54
- package/dist/index.browser.d.mts +204 -61
- package/dist/index.browser.d.ts +204 -0
- package/dist/index.browser.mjs +1 -61
- package/dist/index.server.cjs +2 -246
- package/dist/index.server.d.cts +13 -7
- package/dist/index.server.d.mts +204 -61
- package/dist/index.server.d.ts +13 -7
- package/dist/index.server.mjs +1 -61
- package/dist/packem_shared/Colorize-BUAQi0t0.js +2 -0
- package/dist/packem_shared/Colorize-i0NybjSp.js +1 -0
- package/dist/packem_shared/GradientBuilder-CudosKb8.cjs +1 -0
- package/dist/packem_shared/GradientBuilder-Du8WSL23.mjs +1 -0
- package/dist/packem_shared/colorize.server-BkQZGeaS.mjs +2 -0
- package/dist/packem_shared/colorize.server-Dn-gV0MN.cjs +2 -0
- package/dist/packem_shared/convertHexToRgb-CJNE3k_E.mjs +1 -0
- package/dist/packem_shared/convertHexToRgb-Dvalc5FD.cjs +1 -0
- package/dist/packem_shared/rgbToAnsi256--f09kvlF.cjs +1 -0
- package/dist/packem_shared/rgbToAnsi256-YETEPW8R.mjs +1 -0
- package/dist/packem_shared/types.d-bhP-2hCu.d.cts +154 -0
- package/dist/packem_shared/types.d-bhP-2hCu.d.mts +154 -0
- package/dist/packem_shared/types.d-bhP-2hCu.d.ts +154 -0
- package/dist/template.cjs +2 -144
- package/dist/template.d.cts +10 -4
- package/dist/template.d.mts +4 -4
- package/dist/template.d.ts +10 -4
- package/dist/template.mjs +2 -138
- package/dist/utils.cjs +1 -13
- package/dist/utils.d.cts +13 -2
- package/dist/utils.d.mts +13 -2
- package/dist/utils.d.ts +13 -2
- package/dist/utils.mjs +1 -2
- package/package.json +50 -50
- package/dist/ansi-codes.d.cts +0 -18
- package/dist/ansi-codes.d.mts +0 -18
- package/dist/ansi-codes.d.ts +0 -18
- package/dist/colorize.browser.d.mts +0 -3
- package/dist/colorize.server.d.cts +0 -10
- package/dist/colorize.server.d.mts +0 -10
- package/dist/colorize.server.d.ts +0 -10
- package/dist/css-code.d.mts +0 -11
- package/dist/gradient/gradient-builder.d.cts +0 -10
- package/dist/gradient/gradient-builder.d.mts +0 -10
- package/dist/gradient/gradient-builder.d.ts +0 -10
- package/dist/gradient/util/color-names.d.cts +0 -2
- package/dist/gradient/util/color-names.d.mts +0 -2
- package/dist/gradient/util/color-names.d.ts +0 -2
- package/dist/gradient/util/compute.d.cts +0 -2
- package/dist/gradient/util/compute.d.mts +0 -2
- package/dist/gradient/util/compute.d.ts +0 -2
- package/dist/gradient/util/hsv-to-rgb.d.cts +0 -5
- package/dist/gradient/util/hsv-to-rgb.d.mts +0 -5
- package/dist/gradient/util/hsv-to-rgb.d.ts +0 -5
- package/dist/gradient/util/interpolate.d.cts +0 -3
- package/dist/gradient/util/interpolate.d.mts +0 -3
- package/dist/gradient/util/interpolate.d.ts +0 -3
- package/dist/gradient/util/rgb-to-hsv.d.cts +0 -9
- package/dist/gradient/util/rgb-to-hsv.d.mts +0 -9
- package/dist/gradient/util/rgb-to-hsv.d.ts +0 -9
- package/dist/packem_shared/Colorize-BenP3bFn.mjs +0 -241
- package/dist/packem_shared/Colorize-Ca9CXTcj.mjs +0 -413
- package/dist/packem_shared/GradientBuilder-BXOgJeHi.cjs +0 -490
- package/dist/packem_shared/GradientBuilder-DTnSGyYW.mjs +0 -486
- package/dist/packem_shared/colorize.server-BA3gZZXz.cjs +0 -193
- package/dist/packem_shared/colorize.server-ry9FZNfG.mjs +0 -191
- package/dist/packem_shared/convertHexToRgb-CWdAm2kE.mjs +0 -13
- package/dist/packem_shared/convertHexToRgb-DvkHBM3-.cjs +0 -17
- package/dist/packem_shared/rgbToAnsi256-BdS0fomP.mjs +0 -41
- package/dist/packem_shared/rgbToAnsi256-DL8eajTz.cjs +0 -47
- package/dist/template/make-colorize-template.d.cts +0 -9
- package/dist/template/make-colorize-template.d.mts +0 -9
- package/dist/template/make-colorize-template.d.ts +0 -9
- package/dist/template/make-template.d.cts +0 -10
- package/dist/template/make-template.d.mts +0 -10
- package/dist/template/make-template.d.ts +0 -10
- package/dist/types.d.cts +0 -174
- package/dist/types.d.mts +0 -174
- package/dist/types.d.ts +0 -174
- package/dist/util/ansi-code-hex-map.d.mts +0 -8
- package/dist/util/clamp.d.cts +0 -12
- package/dist/util/clamp.d.mts +0 -12
- package/dist/util/clamp.d.ts +0 -12
- package/dist/util/convert-hex-to-rgb.d.cts +0 -22
- package/dist/util/convert-hex-to-rgb.d.mts +0 -22
- package/dist/util/convert-hex-to-rgb.d.ts +0 -22
- package/dist/util/convert-rgb-to-ansi.d.cts +0 -18
- package/dist/util/convert-rgb-to-ansi.d.mts +0 -18
- package/dist/util/convert-rgb-to-ansi.d.ts +0 -18
- package/dist/util/string-replace-all.d.cts +0 -12
- package/dist/util/string-replace-all.d.mts +0 -12
- package/dist/util/string-replace-all.d.ts +0 -12
- package/dist/util/unescape.d.cts +0 -9
- package/dist/util/unescape.d.mts +0 -9
- package/dist/util/unescape.d.ts +0 -9
package/dist/index.browser.d.mts
CHANGED
|
@@ -1,61 +1,204 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
type ColorValueHex = `#${string}`;
|
|
2
|
+
interface ColorizeType {
|
|
3
|
+
/**
|
|
4
|
+
* Return styled string.
|
|
5
|
+
* @param {string | TemplateStringsArray} string
|
|
6
|
+
*/
|
|
7
|
+
(string: number | string): string;
|
|
8
|
+
(string: TemplateStringsArray, ...parameters: string[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Set [256-color ANSI code](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) for foreground color.
|
|
11
|
+
*
|
|
12
|
+
* Code ranges:
|
|
13
|
+
* ```
|
|
14
|
+
* 0 - 7: standard colors
|
|
15
|
+
* 8 - 15: high intensity colors
|
|
16
|
+
* 16 - 231: 6 × 6 × 6 cube (216 colors)
|
|
17
|
+
* 232 - 255: grayscale from black to white in 24 steps
|
|
18
|
+
* ```
|
|
19
|
+
* @param {number} code in range [0, 255].
|
|
20
|
+
*/
|
|
21
|
+
ansi256: (code: number) => this;
|
|
22
|
+
/**
|
|
23
|
+
* Alias for bgAnsi256.
|
|
24
|
+
* @param {number} code in range [0, 255].
|
|
25
|
+
*/
|
|
26
|
+
bg: (code: number) => this;
|
|
27
|
+
/**
|
|
28
|
+
* Set [256-color ANSI code](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) for background color.
|
|
29
|
+
*
|
|
30
|
+
* Code ranges:
|
|
31
|
+
* ```
|
|
32
|
+
* 0 - 7: standard colors
|
|
33
|
+
* 8 - 15: high intensity colors
|
|
34
|
+
* 16 - 231: 6 × 6 × 6 cube (216 colors)
|
|
35
|
+
* 232 - 255: grayscale from black to white in 24 steps
|
|
36
|
+
* ```
|
|
37
|
+
* @param {number} code in range [0, 255].
|
|
38
|
+
*/
|
|
39
|
+
bgAnsi256: (code: number) => this;
|
|
40
|
+
readonly bgBlack: this;
|
|
41
|
+
readonly bgBlackBright: this;
|
|
42
|
+
readonly bgBlue: this;
|
|
43
|
+
readonly bgBlueBright: this;
|
|
44
|
+
readonly bgCyan: this;
|
|
45
|
+
readonly bgCyanBright: this;
|
|
46
|
+
readonly bgGray: this;
|
|
47
|
+
readonly bgGreen: this;
|
|
48
|
+
readonly bgGreenBright: this;
|
|
49
|
+
readonly bgGrey: this;
|
|
50
|
+
/**
|
|
51
|
+
* Set HEX value for background color.
|
|
52
|
+
* @param {string} color
|
|
53
|
+
*/
|
|
54
|
+
bgHex: (color: ColorValueHex) => this;
|
|
55
|
+
readonly bgMagenta: this;
|
|
56
|
+
readonly bgMagentaBright: this;
|
|
57
|
+
readonly bgRed: this;
|
|
58
|
+
readonly bgRedBright: this;
|
|
59
|
+
/**
|
|
60
|
+
* Set RGB values for background color.
|
|
61
|
+
* @param {number} red The red value, in range [0, 255].
|
|
62
|
+
* @param {number} green The green value, in range [0, 255].
|
|
63
|
+
* @param {number} blue The blue value, in range [0, 255].
|
|
64
|
+
*/
|
|
65
|
+
bgRgb: (red: number, green: number, blue: number) => this;
|
|
66
|
+
readonly bgWhite: this;
|
|
67
|
+
readonly bgWhiteBright: this;
|
|
68
|
+
readonly bgYellow: this;
|
|
69
|
+
readonly bgYellowBright: this;
|
|
70
|
+
readonly black: this;
|
|
71
|
+
readonly blackBright: this;
|
|
72
|
+
readonly blue: this;
|
|
73
|
+
readonly blueBright: this;
|
|
74
|
+
/** <b>Bold</b> style (high intensity). */
|
|
75
|
+
readonly bold: this;
|
|
76
|
+
/** The ANSI escape sequences for ending the current style. */
|
|
77
|
+
readonly close: string;
|
|
78
|
+
readonly cyan: this;
|
|
79
|
+
readonly cyanBright: this;
|
|
80
|
+
/** Faint style (low intensity or dim). */
|
|
81
|
+
readonly dim: this;
|
|
82
|
+
/**
|
|
83
|
+
* Alias for ansi256.
|
|
84
|
+
* @param {number} code in range [0, 255].
|
|
85
|
+
*/
|
|
86
|
+
fg: (code: number) => this;
|
|
87
|
+
readonly gray: this;
|
|
88
|
+
readonly green: this;
|
|
89
|
+
readonly greenBright: this;
|
|
90
|
+
readonly grey: this;
|
|
91
|
+
/**
|
|
92
|
+
* Set HEX value for foreground color.
|
|
93
|
+
* @param {string} color
|
|
94
|
+
*/
|
|
95
|
+
hex: (color: ColorValueHex) => this;
|
|
96
|
+
/** Print the invisible text. */
|
|
97
|
+
readonly hidden: this;
|
|
98
|
+
/** Invert background and foreground colors. */
|
|
99
|
+
readonly inverse: this;
|
|
100
|
+
/** <i>Italic</i> style. (Not widely supported) */
|
|
101
|
+
readonly italic: this;
|
|
102
|
+
readonly magenta: this;
|
|
103
|
+
readonly magentaBright: this;
|
|
104
|
+
/** The ANSI escape sequences for starting the current style. */
|
|
105
|
+
readonly open: string;
|
|
106
|
+
/** O̅v̅e̅r̅l̅i̅n̅e̅ style. (Not widely supported) */
|
|
107
|
+
readonly overline: this;
|
|
108
|
+
readonly red: this;
|
|
109
|
+
readonly redBright: this;
|
|
110
|
+
/** Reset the current style. */
|
|
111
|
+
readonly reset: this;
|
|
112
|
+
/**
|
|
113
|
+
* Set RGB values for foreground color.
|
|
114
|
+
* @param {number} red The red value, in range [0, 255].
|
|
115
|
+
* @param {number} green The green value, in range [0, 255].
|
|
116
|
+
* @param {number} blue The blue value, in range [0, 255].
|
|
117
|
+
*/
|
|
118
|
+
rgb: (red: number, green: number, blue: number) => this;
|
|
119
|
+
/** S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ style. (Not widely supported) The alias for `strikethrough`. */
|
|
120
|
+
readonly strike: this;
|
|
121
|
+
/** S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ style. (Not widely supported) */
|
|
122
|
+
readonly strikethrough: this;
|
|
123
|
+
/**
|
|
124
|
+
* Remove ANSI styling codes.
|
|
125
|
+
* @param {string} string
|
|
126
|
+
* @returns {string}
|
|
127
|
+
*/
|
|
128
|
+
strip: (string: string) => string;
|
|
129
|
+
/** U̲n̲d̲e̲r̲l̲i̲n̲e̲ style. (Not widely supported) */
|
|
130
|
+
readonly underline: this;
|
|
131
|
+
/** Print visible text without ANSI styling. */
|
|
132
|
+
readonly visible: this;
|
|
133
|
+
readonly white: this;
|
|
134
|
+
readonly whiteBright: this;
|
|
135
|
+
readonly yellow: this;
|
|
136
|
+
readonly yellowBright: this;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Base ANSI Styles
|
|
140
|
+
*/
|
|
141
|
+
type AnsiStyles = "bold" | "dim" | "hidden" | "inverse" | "italic" | "overline" | "reset" | "strike" | "strikethrough" | "underline" | "visible";
|
|
142
|
+
/**
|
|
143
|
+
* Base ANSI Colors
|
|
144
|
+
*/
|
|
145
|
+
type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright";
|
|
146
|
+
declare const WebColorize: new () => ColorizeType;
|
|
147
|
+
declare const colorize: ColorizeType;
|
|
148
|
+
declare const ansi256: (code: number) => ColorizeType;
|
|
149
|
+
declare const bg: (code: number) => ColorizeType;
|
|
150
|
+
declare const bgAnsi256: (code: number) => ColorizeType;
|
|
151
|
+
declare const bgHex: (color: ColorValueHex) => ColorizeType;
|
|
152
|
+
declare const bgRgb: (red: number, green: number, blue: number) => ColorizeType;
|
|
153
|
+
declare const fg: (code: number) => ColorizeType;
|
|
154
|
+
declare const hex: (color: ColorValueHex) => ColorizeType;
|
|
155
|
+
declare const rgb: (red: number, green: number, blue: number) => ColorizeType;
|
|
156
|
+
declare const strip: (string: string) => string;
|
|
157
|
+
declare const bgBlack: ColorizeType;
|
|
158
|
+
declare const bgBlackBright: ColorizeType;
|
|
159
|
+
declare const bgBlue: ColorizeType;
|
|
160
|
+
declare const bgBlueBright: ColorizeType;
|
|
161
|
+
declare const bgCyan: ColorizeType;
|
|
162
|
+
declare const bgCyanBright: ColorizeType;
|
|
163
|
+
declare const bgGray: ColorizeType;
|
|
164
|
+
declare const bgGreen: ColorizeType;
|
|
165
|
+
declare const bgGreenBright: ColorizeType;
|
|
166
|
+
declare const bgGrey: ColorizeType;
|
|
167
|
+
declare const bgMagenta: ColorizeType;
|
|
168
|
+
declare const bgMagentaBright: ColorizeType;
|
|
169
|
+
declare const bgRed: ColorizeType;
|
|
170
|
+
declare const bgRedBright: ColorizeType;
|
|
171
|
+
declare const bgWhite: ColorizeType;
|
|
172
|
+
declare const bgWhiteBright: ColorizeType;
|
|
173
|
+
declare const bgYellow: ColorizeType;
|
|
174
|
+
declare const bgYellowBright: ColorizeType;
|
|
175
|
+
declare const black: ColorizeType;
|
|
176
|
+
declare const blackBright: ColorizeType;
|
|
177
|
+
declare const blue: ColorizeType;
|
|
178
|
+
declare const blueBright: ColorizeType;
|
|
179
|
+
declare const bold: ColorizeType;
|
|
180
|
+
declare const cyan: ColorizeType;
|
|
181
|
+
declare const cyanBright: ColorizeType;
|
|
182
|
+
declare const dim: ColorizeType;
|
|
183
|
+
declare const gray: ColorizeType;
|
|
184
|
+
declare const green: ColorizeType;
|
|
185
|
+
declare const greenBright: ColorizeType;
|
|
186
|
+
declare const grey: ColorizeType;
|
|
187
|
+
declare const hidden: ColorizeType;
|
|
188
|
+
declare const inverse: ColorizeType;
|
|
189
|
+
declare const italic: ColorizeType;
|
|
190
|
+
declare const magenta: ColorizeType;
|
|
191
|
+
declare const magentaBright: ColorizeType;
|
|
192
|
+
declare const overline: ColorizeType;
|
|
193
|
+
declare const red: ColorizeType;
|
|
194
|
+
declare const redBright: ColorizeType;
|
|
195
|
+
declare const reset: ColorizeType;
|
|
196
|
+
declare const strike: ColorizeType;
|
|
197
|
+
declare const strikethrough: ColorizeType;
|
|
198
|
+
declare const underline: ColorizeType;
|
|
199
|
+
declare const visible: ColorizeType;
|
|
200
|
+
declare const white: ColorizeType;
|
|
201
|
+
declare const whiteBright: ColorizeType;
|
|
202
|
+
declare const yellow: ColorizeType;
|
|
203
|
+
declare const yellowBright: ColorizeType;
|
|
204
|
+
export { type AnsiColors, type AnsiStyles, WebColorize as Colorize, type ColorizeType, ansi256, bg, bgAnsi256, bgBlack, bgBlackBright, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgGrey, bgHex, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgRgb, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blackBright, blue, blueBright, bold, cyan, cyanBright, colorize as default, dim, fg, gray, green, greenBright, grey, hex, hidden, inverse, italic, magenta, magentaBright, overline, red, redBright, reset, rgb, strike, strikethrough, strip, underline, visible, white, whiteBright, yellow, yellowBright };
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
type ColorValueHex = `#${string}`;
|
|
2
|
+
interface ColorizeType {
|
|
3
|
+
/**
|
|
4
|
+
* Return styled string.
|
|
5
|
+
* @param {string | TemplateStringsArray} string
|
|
6
|
+
*/
|
|
7
|
+
(string: number | string): string;
|
|
8
|
+
(string: TemplateStringsArray, ...parameters: string[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Set [256-color ANSI code](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) for foreground color.
|
|
11
|
+
*
|
|
12
|
+
* Code ranges:
|
|
13
|
+
* ```
|
|
14
|
+
* 0 - 7: standard colors
|
|
15
|
+
* 8 - 15: high intensity colors
|
|
16
|
+
* 16 - 231: 6 × 6 × 6 cube (216 colors)
|
|
17
|
+
* 232 - 255: grayscale from black to white in 24 steps
|
|
18
|
+
* ```
|
|
19
|
+
* @param {number} code in range [0, 255].
|
|
20
|
+
*/
|
|
21
|
+
ansi256: (code: number) => this;
|
|
22
|
+
/**
|
|
23
|
+
* Alias for bgAnsi256.
|
|
24
|
+
* @param {number} code in range [0, 255].
|
|
25
|
+
*/
|
|
26
|
+
bg: (code: number) => this;
|
|
27
|
+
/**
|
|
28
|
+
* Set [256-color ANSI code](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) for background color.
|
|
29
|
+
*
|
|
30
|
+
* Code ranges:
|
|
31
|
+
* ```
|
|
32
|
+
* 0 - 7: standard colors
|
|
33
|
+
* 8 - 15: high intensity colors
|
|
34
|
+
* 16 - 231: 6 × 6 × 6 cube (216 colors)
|
|
35
|
+
* 232 - 255: grayscale from black to white in 24 steps
|
|
36
|
+
* ```
|
|
37
|
+
* @param {number} code in range [0, 255].
|
|
38
|
+
*/
|
|
39
|
+
bgAnsi256: (code: number) => this;
|
|
40
|
+
readonly bgBlack: this;
|
|
41
|
+
readonly bgBlackBright: this;
|
|
42
|
+
readonly bgBlue: this;
|
|
43
|
+
readonly bgBlueBright: this;
|
|
44
|
+
readonly bgCyan: this;
|
|
45
|
+
readonly bgCyanBright: this;
|
|
46
|
+
readonly bgGray: this;
|
|
47
|
+
readonly bgGreen: this;
|
|
48
|
+
readonly bgGreenBright: this;
|
|
49
|
+
readonly bgGrey: this;
|
|
50
|
+
/**
|
|
51
|
+
* Set HEX value for background color.
|
|
52
|
+
* @param {string} color
|
|
53
|
+
*/
|
|
54
|
+
bgHex: (color: ColorValueHex) => this;
|
|
55
|
+
readonly bgMagenta: this;
|
|
56
|
+
readonly bgMagentaBright: this;
|
|
57
|
+
readonly bgRed: this;
|
|
58
|
+
readonly bgRedBright: this;
|
|
59
|
+
/**
|
|
60
|
+
* Set RGB values for background color.
|
|
61
|
+
* @param {number} red The red value, in range [0, 255].
|
|
62
|
+
* @param {number} green The green value, in range [0, 255].
|
|
63
|
+
* @param {number} blue The blue value, in range [0, 255].
|
|
64
|
+
*/
|
|
65
|
+
bgRgb: (red: number, green: number, blue: number) => this;
|
|
66
|
+
readonly bgWhite: this;
|
|
67
|
+
readonly bgWhiteBright: this;
|
|
68
|
+
readonly bgYellow: this;
|
|
69
|
+
readonly bgYellowBright: this;
|
|
70
|
+
readonly black: this;
|
|
71
|
+
readonly blackBright: this;
|
|
72
|
+
readonly blue: this;
|
|
73
|
+
readonly blueBright: this;
|
|
74
|
+
/** <b>Bold</b> style (high intensity). */
|
|
75
|
+
readonly bold: this;
|
|
76
|
+
/** The ANSI escape sequences for ending the current style. */
|
|
77
|
+
readonly close: string;
|
|
78
|
+
readonly cyan: this;
|
|
79
|
+
readonly cyanBright: this;
|
|
80
|
+
/** Faint style (low intensity or dim). */
|
|
81
|
+
readonly dim: this;
|
|
82
|
+
/**
|
|
83
|
+
* Alias for ansi256.
|
|
84
|
+
* @param {number} code in range [0, 255].
|
|
85
|
+
*/
|
|
86
|
+
fg: (code: number) => this;
|
|
87
|
+
readonly gray: this;
|
|
88
|
+
readonly green: this;
|
|
89
|
+
readonly greenBright: this;
|
|
90
|
+
readonly grey: this;
|
|
91
|
+
/**
|
|
92
|
+
* Set HEX value for foreground color.
|
|
93
|
+
* @param {string} color
|
|
94
|
+
*/
|
|
95
|
+
hex: (color: ColorValueHex) => this;
|
|
96
|
+
/** Print the invisible text. */
|
|
97
|
+
readonly hidden: this;
|
|
98
|
+
/** Invert background and foreground colors. */
|
|
99
|
+
readonly inverse: this;
|
|
100
|
+
/** <i>Italic</i> style. (Not widely supported) */
|
|
101
|
+
readonly italic: this;
|
|
102
|
+
readonly magenta: this;
|
|
103
|
+
readonly magentaBright: this;
|
|
104
|
+
/** The ANSI escape sequences for starting the current style. */
|
|
105
|
+
readonly open: string;
|
|
106
|
+
/** O̅v̅e̅r̅l̅i̅n̅e̅ style. (Not widely supported) */
|
|
107
|
+
readonly overline: this;
|
|
108
|
+
readonly red: this;
|
|
109
|
+
readonly redBright: this;
|
|
110
|
+
/** Reset the current style. */
|
|
111
|
+
readonly reset: this;
|
|
112
|
+
/**
|
|
113
|
+
* Set RGB values for foreground color.
|
|
114
|
+
* @param {number} red The red value, in range [0, 255].
|
|
115
|
+
* @param {number} green The green value, in range [0, 255].
|
|
116
|
+
* @param {number} blue The blue value, in range [0, 255].
|
|
117
|
+
*/
|
|
118
|
+
rgb: (red: number, green: number, blue: number) => this;
|
|
119
|
+
/** S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ style. (Not widely supported) The alias for `strikethrough`. */
|
|
120
|
+
readonly strike: this;
|
|
121
|
+
/** S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ style. (Not widely supported) */
|
|
122
|
+
readonly strikethrough: this;
|
|
123
|
+
/**
|
|
124
|
+
* Remove ANSI styling codes.
|
|
125
|
+
* @param {string} string
|
|
126
|
+
* @returns {string}
|
|
127
|
+
*/
|
|
128
|
+
strip: (string: string) => string;
|
|
129
|
+
/** U̲n̲d̲e̲r̲l̲i̲n̲e̲ style. (Not widely supported) */
|
|
130
|
+
readonly underline: this;
|
|
131
|
+
/** Print visible text without ANSI styling. */
|
|
132
|
+
readonly visible: this;
|
|
133
|
+
readonly white: this;
|
|
134
|
+
readonly whiteBright: this;
|
|
135
|
+
readonly yellow: this;
|
|
136
|
+
readonly yellowBright: this;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Base ANSI Styles
|
|
140
|
+
*/
|
|
141
|
+
type AnsiStyles = "bold" | "dim" | "hidden" | "inverse" | "italic" | "overline" | "reset" | "strike" | "strikethrough" | "underline" | "visible";
|
|
142
|
+
/**
|
|
143
|
+
* Base ANSI Colors
|
|
144
|
+
*/
|
|
145
|
+
type AnsiColors = "bgBlack" | "bgBlackBright" | "bgBlue" | "bgBlueBright" | "bgCyan" | "bgCyanBright" | "bgGray" | "bgGreen" | "bgGreenBright" | "bgGrey" | "bgMagenta" | "bgMagentaBright" | "bgRed" | "bgRedBright" | "bgWhite" | "bgWhiteBright" | "bgYellow" | "bgYellowBright" | "black" | "blackBright" | "blue" | "blueBright" | "cyan" | "cyanBright" | "gray" | "green" | "greenBright" | "grey" | "magenta" | "magentaBright" | "red" | "redBright" | "white" | "whiteBright" | "yellow" | "yellowBright";
|
|
146
|
+
declare const WebColorize: new () => ColorizeType;
|
|
147
|
+
declare const colorize: ColorizeType;
|
|
148
|
+
declare const ansi256: (code: number) => ColorizeType;
|
|
149
|
+
declare const bg: (code: number) => ColorizeType;
|
|
150
|
+
declare const bgAnsi256: (code: number) => ColorizeType;
|
|
151
|
+
declare const bgHex: (color: ColorValueHex) => ColorizeType;
|
|
152
|
+
declare const bgRgb: (red: number, green: number, blue: number) => ColorizeType;
|
|
153
|
+
declare const fg: (code: number) => ColorizeType;
|
|
154
|
+
declare const hex: (color: ColorValueHex) => ColorizeType;
|
|
155
|
+
declare const rgb: (red: number, green: number, blue: number) => ColorizeType;
|
|
156
|
+
declare const strip: (string: string) => string;
|
|
157
|
+
declare const bgBlack: ColorizeType;
|
|
158
|
+
declare const bgBlackBright: ColorizeType;
|
|
159
|
+
declare const bgBlue: ColorizeType;
|
|
160
|
+
declare const bgBlueBright: ColorizeType;
|
|
161
|
+
declare const bgCyan: ColorizeType;
|
|
162
|
+
declare const bgCyanBright: ColorizeType;
|
|
163
|
+
declare const bgGray: ColorizeType;
|
|
164
|
+
declare const bgGreen: ColorizeType;
|
|
165
|
+
declare const bgGreenBright: ColorizeType;
|
|
166
|
+
declare const bgGrey: ColorizeType;
|
|
167
|
+
declare const bgMagenta: ColorizeType;
|
|
168
|
+
declare const bgMagentaBright: ColorizeType;
|
|
169
|
+
declare const bgRed: ColorizeType;
|
|
170
|
+
declare const bgRedBright: ColorizeType;
|
|
171
|
+
declare const bgWhite: ColorizeType;
|
|
172
|
+
declare const bgWhiteBright: ColorizeType;
|
|
173
|
+
declare const bgYellow: ColorizeType;
|
|
174
|
+
declare const bgYellowBright: ColorizeType;
|
|
175
|
+
declare const black: ColorizeType;
|
|
176
|
+
declare const blackBright: ColorizeType;
|
|
177
|
+
declare const blue: ColorizeType;
|
|
178
|
+
declare const blueBright: ColorizeType;
|
|
179
|
+
declare const bold: ColorizeType;
|
|
180
|
+
declare const cyan: ColorizeType;
|
|
181
|
+
declare const cyanBright: ColorizeType;
|
|
182
|
+
declare const dim: ColorizeType;
|
|
183
|
+
declare const gray: ColorizeType;
|
|
184
|
+
declare const green: ColorizeType;
|
|
185
|
+
declare const greenBright: ColorizeType;
|
|
186
|
+
declare const grey: ColorizeType;
|
|
187
|
+
declare const hidden: ColorizeType;
|
|
188
|
+
declare const inverse: ColorizeType;
|
|
189
|
+
declare const italic: ColorizeType;
|
|
190
|
+
declare const magenta: ColorizeType;
|
|
191
|
+
declare const magentaBright: ColorizeType;
|
|
192
|
+
declare const overline: ColorizeType;
|
|
193
|
+
declare const red: ColorizeType;
|
|
194
|
+
declare const redBright: ColorizeType;
|
|
195
|
+
declare const reset: ColorizeType;
|
|
196
|
+
declare const strike: ColorizeType;
|
|
197
|
+
declare const strikethrough: ColorizeType;
|
|
198
|
+
declare const underline: ColorizeType;
|
|
199
|
+
declare const visible: ColorizeType;
|
|
200
|
+
declare const white: ColorizeType;
|
|
201
|
+
declare const whiteBright: ColorizeType;
|
|
202
|
+
declare const yellow: ColorizeType;
|
|
203
|
+
declare const yellowBright: ColorizeType;
|
|
204
|
+
export { type AnsiColors, type AnsiStyles, WebColorize as Colorize, type ColorizeType, ansi256, bg, bgAnsi256, bgBlack, bgBlackBright, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgGrey, bgHex, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgRgb, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blackBright, blue, blueBright, bold, cyan, cyanBright, colorize as default, dim, fg, gray, green, greenBright, grey, hex, hidden, inverse, italic, magenta, magentaBright, overline, red, redBright, reset, rgb, strike, strikethrough, strip, underline, visible, white, whiteBright, yellow, yellowBright };
|
package/dist/index.browser.mjs
CHANGED
|
@@ -1,61 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const colorize = new WebColorize();
|
|
4
|
-
const ansi256 = colorize.ansi256;
|
|
5
|
-
const bg = colorize.bg;
|
|
6
|
-
const bgAnsi256 = colorize.bgAnsi256;
|
|
7
|
-
const bgHex = colorize.bgHex;
|
|
8
|
-
const bgRgb = colorize.bgRgb;
|
|
9
|
-
const fg = colorize.fg;
|
|
10
|
-
const hex = colorize.hex;
|
|
11
|
-
const rgb = colorize.rgb;
|
|
12
|
-
const strip = colorize.strip;
|
|
13
|
-
const bgBlack = colorize.bgBlack;
|
|
14
|
-
const bgBlackBright = colorize.bgBlackBright;
|
|
15
|
-
const bgBlue = colorize.bgBlue;
|
|
16
|
-
const bgBlueBright = colorize.bgBlueBright;
|
|
17
|
-
const bgCyan = colorize.bgCyan;
|
|
18
|
-
const bgCyanBright = colorize.bgCyanBright;
|
|
19
|
-
const bgGray = colorize.bgGray;
|
|
20
|
-
const bgGreen = colorize.bgGreen;
|
|
21
|
-
const bgGreenBright = colorize.bgGreenBright;
|
|
22
|
-
const bgGrey = colorize.bgGrey;
|
|
23
|
-
const bgMagenta = colorize.bgMagenta;
|
|
24
|
-
const bgMagentaBright = colorize.bgMagentaBright;
|
|
25
|
-
const bgRed = colorize.bgRed;
|
|
26
|
-
const bgRedBright = colorize.bgRedBright;
|
|
27
|
-
const bgWhite = colorize.bgWhite;
|
|
28
|
-
const bgWhiteBright = colorize.bgWhiteBright;
|
|
29
|
-
const bgYellow = colorize.bgYellow;
|
|
30
|
-
const bgYellowBright = colorize.bgYellowBright;
|
|
31
|
-
const black = colorize.black;
|
|
32
|
-
const blackBright = colorize.blackBright;
|
|
33
|
-
const blue = colorize.blue;
|
|
34
|
-
const blueBright = colorize.blueBright;
|
|
35
|
-
const bold = colorize.bold;
|
|
36
|
-
const cyan = colorize.cyan;
|
|
37
|
-
const cyanBright = colorize.cyanBright;
|
|
38
|
-
const dim = colorize.dim;
|
|
39
|
-
const gray = colorize.gray;
|
|
40
|
-
const green = colorize.green;
|
|
41
|
-
const greenBright = colorize.greenBright;
|
|
42
|
-
const grey = colorize.grey;
|
|
43
|
-
const hidden = colorize.hidden;
|
|
44
|
-
const inverse = colorize.inverse;
|
|
45
|
-
const italic = colorize.italic;
|
|
46
|
-
const magenta = colorize.magenta;
|
|
47
|
-
const magentaBright = colorize.magentaBright;
|
|
48
|
-
const overline = colorize.overline;
|
|
49
|
-
const red = colorize.red;
|
|
50
|
-
const redBright = colorize.redBright;
|
|
51
|
-
const reset = colorize.reset;
|
|
52
|
-
const strike = colorize.strike;
|
|
53
|
-
const strikethrough = colorize.strikethrough;
|
|
54
|
-
const underline = colorize.underline;
|
|
55
|
-
const visible = colorize.visible;
|
|
56
|
-
const white = colorize.white;
|
|
57
|
-
const whiteBright = colorize.whiteBright;
|
|
58
|
-
const yellow = colorize.yellow;
|
|
59
|
-
const yellowBright = colorize.yellowBright;
|
|
60
|
-
|
|
61
|
-
export { WebColorize as Colorize, ansi256, bg, bgAnsi256, bgBlack, bgBlackBright, bgBlue, bgBlueBright, bgCyan, bgCyanBright, bgGray, bgGreen, bgGreenBright, bgGrey, bgHex, bgMagenta, bgMagentaBright, bgRed, bgRedBright, bgRgb, bgWhite, bgWhiteBright, bgYellow, bgYellowBright, black, blackBright, blue, blueBright, bold, cyan, cyanBright, colorize as default, dim, fg, gray, green, greenBright, grey, hex, hidden, inverse, italic, magenta, magentaBright, overline, red, redBright, reset, rgb, strike, strikethrough, strip, underline, visible, white, whiteBright, yellow, yellowBright };
|
|
1
|
+
import e from"./packem_shared/Colorize-i0NybjSp.js";const g=new e,i=g.ansi256,t=g.bg,b=g.bgAnsi256,h=g.bgHex,l=g.bgRgb,a=g.fg,n=g.hex,B=g.rgb,o=g.strip,s=g.bgBlack,y=g.bgBlackBright,d=g.bgBlue,c=g.bgBlueBright,u=g.bgCyan,w=g.bgCyanBright,k=g.bgGray,m=g.bgGreen,G=g.bgGreenBright,v=g.bgGrey,R=g.bgMagenta,x=g.bgMagentaBright,C=g.bgRed,f=g.bgRedBright,p=g.bgWhite,M=g.bgWhiteBright,W=g.bgYellow,Y=g.bgYellowBright,A=g.black,H=g.blackBright,j=g.blue,z=g.blueBright,q=g.bold,D=g.cyan,E=g.cyanBright,F=g.dim,I=g.gray,J=g.green,K=g.greenBright,L=g.grey,N=g.hidden,O=g.inverse,P=g.italic,Q=g.magenta,S=g.magentaBright,T=g.overline,U=g.red,V=g.redBright,X=g.reset,Z=g.strike,_=g.strikethrough,$=g.underline,gg=g.visible,eg=g.white,rg=g.whiteBright,ig=g.yellow,tg=g.yellowBright;export{e as Colorize,i as ansi256,t as bg,b as bgAnsi256,s as bgBlack,y as bgBlackBright,d as bgBlue,c as bgBlueBright,u as bgCyan,w as bgCyanBright,k as bgGray,m as bgGreen,G as bgGreenBright,v as bgGrey,h as bgHex,R as bgMagenta,x as bgMagentaBright,C as bgRed,f as bgRedBright,l as bgRgb,p as bgWhite,M as bgWhiteBright,W as bgYellow,Y as bgYellowBright,A as black,H as blackBright,j as blue,z as blueBright,q as bold,D as cyan,E as cyanBright,g as default,F as dim,a as fg,I as gray,J as green,K as greenBright,L as grey,n as hex,N as hidden,O as inverse,P as italic,Q as magenta,S as magentaBright,T as overline,U as red,V as redBright,X as reset,B as rgb,Z as strike,_ as strikethrough,o as strip,$ as underline,gg as visible,eg as white,rg as whiteBright,ig as yellow,tg as yellowBright};
|