@visulima/colorize 2.0.0-alpha.10 → 2.0.0-alpha.12
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 +36 -0
- package/dist/gradient.cjs +3 -62
- 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 -56
- package/dist/index.browser.d.mts +203 -60
- package/dist/index.browser.d.ts +204 -0
- package/dist/index.browser.mjs +1 -61
- package/dist/index.server.cjs +2 -255
- package/dist/index.server.d.cts +12 -6
- package/dist/index.server.d.mts +203 -60
- package/dist/index.server.d.ts +12 -6
- 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 -152
- 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 -146
- 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 +13 -13
- 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-BQ-Wlgs0.js +0 -409
- package/dist/packem_shared/Colorize-rJUN0RFg.js +0 -250
- package/dist/packem_shared/GradientBuilder-CkX4Imo9.mjs +0 -483
- package/dist/packem_shared/GradientBuilder-DRrwebdU.cjs +0 -487
- package/dist/packem_shared/colorize.server-CwTmhs0e.cjs +0 -198
- package/dist/packem_shared/colorize.server-YxoHIDUp.mjs +0 -196
- package/dist/packem_shared/convertHexToRgb-51-edHxE.cjs +0 -21
- package/dist/packem_shared/convertHexToRgb-BZwJEiMZ.mjs +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 -8
- package/dist/util/convert-hex-to-rgb.d.mts +0 -8
- package/dist/util/convert-hex-to-rgb.d.ts +0 -8
- 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/types.d.mts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
export type ColorValueHex = `#${string}`;
|
|
2
|
-
export 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
|
-
export type ColorData = {
|
|
139
|
-
close: string;
|
|
140
|
-
open: string;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Base ANSI Styles
|
|
144
|
-
*/
|
|
145
|
-
export type AnsiStyles = "bold" | "dim" | "hidden" | "inverse" | "italic" | "overline" | "reset" | "strike" | "strikethrough" | "underline" | "visible";
|
|
146
|
-
/**
|
|
147
|
-
* Base ANSI Colors
|
|
148
|
-
*/
|
|
149
|
-
export 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";
|
|
150
|
-
export type CssColorName = "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "grey" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen";
|
|
151
|
-
export type CssColorCodes = {
|
|
152
|
-
[key in CssColorName]: [number, number, number];
|
|
153
|
-
};
|
|
154
|
-
export type StopInput = {
|
|
155
|
-
color?: ColorValueHex | CssColorName | RGB | [number, number, number];
|
|
156
|
-
colorLess?: boolean;
|
|
157
|
-
position: number;
|
|
158
|
-
};
|
|
159
|
-
export type StopOutput = {
|
|
160
|
-
color: [number, number, number] | undefined;
|
|
161
|
-
colorLess?: boolean;
|
|
162
|
-
position: number;
|
|
163
|
-
};
|
|
164
|
-
export type RGB = {
|
|
165
|
-
b: number;
|
|
166
|
-
g: number;
|
|
167
|
-
r: number;
|
|
168
|
-
};
|
|
169
|
-
export type HSVA = {
|
|
170
|
-
a?: number;
|
|
171
|
-
h: number;
|
|
172
|
-
s: number;
|
|
173
|
-
v: number;
|
|
174
|
-
};
|
package/dist/types.d.ts
DELETED
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
export type ColorValueHex = `#${string}`;
|
|
2
|
-
export 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
|
-
export type ColorData = {
|
|
139
|
-
close: string;
|
|
140
|
-
open: string;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Base ANSI Styles
|
|
144
|
-
*/
|
|
145
|
-
export type AnsiStyles = "bold" | "dim" | "hidden" | "inverse" | "italic" | "overline" | "reset" | "strike" | "strikethrough" | "underline" | "visible";
|
|
146
|
-
/**
|
|
147
|
-
* Base ANSI Colors
|
|
148
|
-
*/
|
|
149
|
-
export 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";
|
|
150
|
-
export type CssColorName = "aliceblue" | "antiquewhite" | "aqua" | "aquamarine" | "azure" | "beige" | "bisque" | "black" | "blanchedalmond" | "blue" | "blueviolet" | "brown" | "burlywood" | "cadetblue" | "chartreuse" | "chocolate" | "coral" | "cornflowerblue" | "cornsilk" | "crimson" | "cyan" | "darkblue" | "darkcyan" | "darkgoldenrod" | "darkgray" | "darkgreen" | "darkgrey" | "darkkhaki" | "darkmagenta" | "darkolivegreen" | "darkorange" | "darkorchid" | "darkred" | "darksalmon" | "darkseagreen" | "darkslateblue" | "darkslategray" | "darkslategrey" | "darkturquoise" | "darkviolet" | "deeppink" | "deepskyblue" | "dimgray" | "dimgrey" | "dodgerblue" | "firebrick" | "floralwhite" | "forestgreen" | "fuchsia" | "gainsboro" | "ghostwhite" | "gold" | "goldenrod" | "gray" | "green" | "greenyellow" | "grey" | "honeydew" | "hotpink" | "indianred" | "indigo" | "ivory" | "khaki" | "lavender" | "lavenderblush" | "lawngreen" | "lemonchiffon" | "lightblue" | "lightcoral" | "lightcyan" | "lightgoldenrodyellow" | "lightgray" | "lightgreen" | "lightgrey" | "lightpink" | "lightsalmon" | "lightseagreen" | "lightskyblue" | "lightslategray" | "lightslategrey" | "lightsteelblue" | "lightyellow" | "lime" | "limegreen" | "linen" | "magenta" | "maroon" | "mediumaquamarine" | "mediumblue" | "mediumorchid" | "mediumpurple" | "mediumseagreen" | "mediumslateblue" | "mediumspringgreen" | "mediumturquoise" | "mediumvioletred" | "midnightblue" | "mintcream" | "mistyrose" | "moccasin" | "navajowhite" | "navy" | "oldlace" | "olive" | "olivedrab" | "orange" | "orangered" | "orchid" | "palegoldenrod" | "palegreen" | "paleturquoise" | "palevioletred" | "papayawhip" | "peachpuff" | "peru" | "pink" | "plum" | "powderblue" | "purple" | "rebeccapurple" | "red" | "rosybrown" | "royalblue" | "saddlebrown" | "salmon" | "sandybrown" | "seagreen" | "seashell" | "sienna" | "silver" | "skyblue" | "slateblue" | "slategray" | "slategrey" | "snow" | "springgreen" | "steelblue" | "tan" | "teal" | "thistle" | "tomato" | "turquoise" | "violet" | "wheat" | "white" | "whitesmoke" | "yellow" | "yellowgreen";
|
|
151
|
-
export type CssColorCodes = {
|
|
152
|
-
[key in CssColorName]: [number, number, number];
|
|
153
|
-
};
|
|
154
|
-
export type StopInput = {
|
|
155
|
-
color?: ColorValueHex | CssColorName | RGB | [number, number, number];
|
|
156
|
-
colorLess?: boolean;
|
|
157
|
-
position: number;
|
|
158
|
-
};
|
|
159
|
-
export type StopOutput = {
|
|
160
|
-
color: [number, number, number] | undefined;
|
|
161
|
-
colorLess?: boolean;
|
|
162
|
-
position: number;
|
|
163
|
-
};
|
|
164
|
-
export type RGB = {
|
|
165
|
-
b: number;
|
|
166
|
-
g: number;
|
|
167
|
-
r: number;
|
|
168
|
-
};
|
|
169
|
-
export type HSVA = {
|
|
170
|
-
a?: number;
|
|
171
|
-
h: number;
|
|
172
|
-
s: number;
|
|
173
|
-
v: number;
|
|
174
|
-
};
|
package/dist/util/clamp.d.cts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/webdiscus/ansis/blob/master/src/utils.js
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2023, webdiscus
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Clamp a number within the inclusive range specified by min and max.
|
|
10
|
-
* The ternary operator is a tick quicker than Math.min(Math.max(num, min), max).
|
|
11
|
-
*/
|
|
12
|
-
export declare const clamp: (number_: number, min: number, max: number) => number;
|
package/dist/util/clamp.d.mts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/webdiscus/ansis/blob/master/src/utils.js
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2023, webdiscus
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Clamp a number within the inclusive range specified by min and max.
|
|
10
|
-
* The ternary operator is a tick quicker than Math.min(Math.max(num, min), max).
|
|
11
|
-
*/
|
|
12
|
-
export declare const clamp: (number_: number, min: number, max: number) => number;
|
package/dist/util/clamp.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/webdiscus/ansis/blob/master/src/utils.js
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2023, webdiscus
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Clamp a number within the inclusive range specified by min and max.
|
|
10
|
-
* The ternary operator is a tick quicker than Math.min(Math.max(num, min), max).
|
|
11
|
-
*/
|
|
12
|
-
export declare const clamp: (number_: number, min: number, max: number) => number;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copy of https://github.com/Qix-/color-convert/blob/master/conversions.js#L551
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>.
|
|
7
|
-
* Copyright (c) 2016-2021 Josh Junon <josh@junon.me>.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Convert RGB values to approximate code of ANSI 256 colors.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
export declare const rgbToAnsi256: (r: number, g: number, b: number) => number;
|
|
14
|
-
/**
|
|
15
|
-
* Convert ANSI 256 color code to approximate code of ANSI 16 colors.
|
|
16
|
-
*/
|
|
17
|
-
export declare const ansi256To16: (code: number) => number;
|
|
18
|
-
export declare const rgbToAnsi16: (r: number, g: number, b: number) => number;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copy of https://github.com/Qix-/color-convert/blob/master/conversions.js#L551
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>.
|
|
7
|
-
* Copyright (c) 2016-2021 Josh Junon <josh@junon.me>.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Convert RGB values to approximate code of ANSI 256 colors.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
export declare const rgbToAnsi256: (r: number, g: number, b: number) => number;
|
|
14
|
-
/**
|
|
15
|
-
* Convert ANSI 256 color code to approximate code of ANSI 16 colors.
|
|
16
|
-
*/
|
|
17
|
-
export declare const ansi256To16: (code: number) => number;
|
|
18
|
-
export declare const rgbToAnsi16: (r: number, g: number, b: number) => number;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copy of https://github.com/Qix-/color-convert/blob/master/conversions.js#L551
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2011-2016 Heather Arthur <fayearthur@gmail.com>.
|
|
7
|
-
* Copyright (c) 2016-2021 Josh Junon <josh@junon.me>.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Convert RGB values to approximate code of ANSI 256 colors.
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
export declare const rgbToAnsi256: (r: number, g: number, b: number) => number;
|
|
14
|
-
/**
|
|
15
|
-
* Convert ANSI 256 color code to approximate code of ANSI 16 colors.
|
|
16
|
-
*/
|
|
17
|
-
export declare const ansi256To16: (code: number) => number;
|
|
18
|
-
export declare const rgbToAnsi16: (r: number, g: number, b: number) => number;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/webdiscus/ansis/blob/master/src/utils.js
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2023, webdiscus
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Replace all matched strings.
|
|
10
|
-
* Note: this implementation is over 30% faster than String.replaceAll().
|
|
11
|
-
*/
|
|
12
|
-
export declare const stringReplaceAll: (string_: string, searchValue: string, replaceValue: string) => string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/webdiscus/ansis/blob/master/src/utils.js
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2023, webdiscus
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Replace all matched strings.
|
|
10
|
-
* Note: this implementation is over 30% faster than String.replaceAll().
|
|
11
|
-
*/
|
|
12
|
-
export declare const stringReplaceAll: (string_: string, searchValue: string, replaceValue: string) => string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/webdiscus/ansis/blob/master/src/utils.js
|
|
3
|
-
*
|
|
4
|
-
* ISC License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) 2023, webdiscus
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Replace all matched strings.
|
|
10
|
-
* Note: this implementation is over 30% faster than String.replaceAll().
|
|
11
|
-
*/
|
|
12
|
-
export declare const stringReplaceAll: (string_: string, searchValue: string, replaceValue: string) => string;
|
package/dist/util/unescape.d.cts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/chalk/chalk-template/blob/main/index.js
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Josh Junon
|
|
7
|
-
* Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
8
|
-
*/
|
|
9
|
-
export declare const unescape: (c: string) => string;
|
package/dist/util/unescape.d.mts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/chalk/chalk-template/blob/main/index.js
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Josh Junon
|
|
7
|
-
* Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
8
|
-
*/
|
|
9
|
-
export declare const unescape: (c: string) => string;
|
package/dist/util/unescape.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Modified copy of https://github.com/chalk/chalk-template/blob/main/index.js
|
|
3
|
-
*
|
|
4
|
-
* MIT License
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Josh Junon
|
|
7
|
-
* Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
8
|
-
*/
|
|
9
|
-
export declare const unescape: (c: string) => string;
|