@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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,172 @@
|
|
|
1
|
+
## @visulima/colorize [2.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.10...@visulima/colorize@2.0.0-alpha.11) (2026-05-14)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **colorize:** rewrite ternary as if/else to satisfy operator-linebreak ([999c115](https://github.com/visulima/visulima/commit/999c115ee078a601167c972404c6e625813fea1b))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* **colorize:** fix lint conflict between eslint and prettier ([b0a316d](https://github.com/visulima/visulima/commit/b0a316d0ba7f6b7969fe14ce0fee9aae55206453))
|
|
10
|
+
* **colorize:** fix lint errors ([7aac22d](https://github.com/visulima/visulima/commit/7aac22d80dffe22a75881bc89460493381cda317))
|
|
11
|
+
* **colorize:** housekeeping cleanup ([69a01ec](https://github.com/visulima/visulima/commit/69a01ec038aa738b1f4a2504c85ea56f5786edc5))
|
|
12
|
+
* **colorize:** upgrade packem to 2.0.0-alpha.76 ([d912a81](https://github.com/visulima/visulima/commit/d912a81321bdb96047b483deea693375030e63a3))
|
|
13
|
+
* re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
|
|
14
|
+
* simplify pnpm-workspace packages list ([7cab221](https://github.com/visulima/visulima/commit/7cab221163632d9b7aa044a6f88c49083103a869))
|
|
15
|
+
|
|
16
|
+
### Tests
|
|
17
|
+
|
|
18
|
+
* **colorize:** use packages.colors key in bench ([e87c2db](https://github.com/visulima/visulima/commit/e87c2db66eec4883cb22201982d0820461babd6f))
|
|
19
|
+
* repair cerebro, fs, colorize bench CI runs ([03b530e](https://github.com/visulima/visulima/commit/03b530edc678ca6f5c2869ae283f0f3ca6e86c5e))
|
|
20
|
+
|
|
21
|
+
## @visulima/colorize [2.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.9...@visulima/colorize@2.0.0-alpha.10) (2026-04-22)
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
|
|
26
|
+
|
|
27
|
+
### Miscellaneous Chores
|
|
28
|
+
|
|
29
|
+
* bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
|
|
30
|
+
* **colorize:** apply pending changes ([2ef0ef0](https://github.com/visulima/visulima/commit/2ef0ef0f05183a62a442f2390947b955da33a23a))
|
|
31
|
+
* **colorize:** enforce curly braces and apply lint fixes ([aaa9abb](https://github.com/visulima/visulima/commit/aaa9abbf7216ecc6526a40104ad9088235978142))
|
|
32
|
+
* fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### Dependencies
|
|
36
|
+
|
|
37
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.10
|
|
38
|
+
|
|
39
|
+
## @visulima/colorize [2.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.8...@visulima/colorize@2.0.0-alpha.9) (2026-04-15)
|
|
40
|
+
|
|
41
|
+
### Bug Fixes
|
|
42
|
+
|
|
43
|
+
* **colorize:** resolve eslint and formatting issues ([edc292a](https://github.com/visulima/visulima/commit/edc292a567fb3a97e6428e6fee86b47137e00952))
|
|
44
|
+
* **terminal:** resolve eslint and formatting issues ([8f30389](https://github.com/visulima/visulima/commit/8f30389deb9ff81e7afce0aa064ef11fcb179f23))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Dependencies
|
|
48
|
+
|
|
49
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.9
|
|
50
|
+
|
|
51
|
+
## @visulima/colorize [2.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.7...@visulima/colorize@2.0.0-alpha.8) (2026-04-08)
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
* **colorize:** properly fix eslint errors in code ([c9941a4](https://github.com/visulima/visulima/commit/c9941a42e04570c7a4f39e4f65424b507a58352d))
|
|
56
|
+
* resolve failing tests across multiple packages ([2b4b6f0](https://github.com/visulima/visulima/commit/2b4b6f04169b60fdc4cf77b293015436a272c0fb))
|
|
57
|
+
|
|
58
|
+
### Miscellaneous Chores
|
|
59
|
+
|
|
60
|
+
* apply linting and formatting fixes across packages ([5d150a5](https://github.com/visulima/visulima/commit/5d150a578f9ce861c791843c683deeb849b774a9))
|
|
61
|
+
* **colorize:** add tsconfig.eslint.json for type-aware linting ([0a2b596](https://github.com/visulima/visulima/commit/0a2b596b74df932cf492400029ecdaf572b8f474))
|
|
62
|
+
* **colorize:** apply prettier formatting ([f572dc4](https://github.com/visulima/visulima/commit/f572dc47f1398070adc5d4879d9f99870fe71760))
|
|
63
|
+
* **colorize:** migrate .prettierrc.cjs to prettier.config.js ([6d84ecc](https://github.com/visulima/visulima/commit/6d84eccbfba7ff59fd7463ef973b80d50d85f464))
|
|
64
|
+
* **terminal:** remove empty dependency objects from package.json ([562c704](https://github.com/visulima/visulima/commit/562c704e5d90aa2d13eae942ebbdcfeb787c2b46))
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Dependencies
|
|
68
|
+
|
|
69
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.8
|
|
70
|
+
|
|
71
|
+
## @visulima/colorize [2.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.6...@visulima/colorize@2.0.0-alpha.7) (2026-03-26)
|
|
72
|
+
|
|
73
|
+
### Features
|
|
74
|
+
|
|
75
|
+
* **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
|
|
76
|
+
|
|
77
|
+
### Miscellaneous Chores
|
|
78
|
+
|
|
79
|
+
* update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Dependencies
|
|
83
|
+
|
|
84
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.7
|
|
85
|
+
|
|
86
|
+
## @visulima/colorize [2.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.5...@visulima/colorize@2.0.0-alpha.6) (2026-03-26)
|
|
87
|
+
|
|
88
|
+
### Bug Fixes
|
|
89
|
+
|
|
90
|
+
* **colorize:** use workspace:* for internal [@visulima](https://github.com/visulima) deps ([65da9d0](https://github.com/visulima/visulima/commit/65da9d038280a836a925fc264186506841b89add))
|
|
91
|
+
* **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
|
|
92
|
+
|
|
93
|
+
### Miscellaneous Chores
|
|
94
|
+
|
|
95
|
+
* **colorize:** migrate deps to pnpm catalogs ([72117a7](https://github.com/visulima/visulima/commit/72117a7e915e99b81517a67a61bce44bf58bc23e))
|
|
96
|
+
* **colorize:** update dependencies ([ec10901](https://github.com/visulima/visulima/commit/ec109011e995724aaff2276344c18619c4c96ad9))
|
|
97
|
+
* visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
### Dependencies
|
|
101
|
+
|
|
102
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.6
|
|
103
|
+
|
|
104
|
+
## @visulima/colorize [2.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.4...@visulima/colorize@2.0.0-alpha.5) (2026-03-06)
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
* **colorize:** update packem to 2.0.0-alpha.54 ([61e248b](https://github.com/visulima/visulima/commit/61e248be63d5e3ad069aae06d5f0a76e5ca58600))
|
|
109
|
+
|
|
110
|
+
### Documentation
|
|
111
|
+
|
|
112
|
+
* **object,redact,colorize,path,fs:** add comprehensive Fumadocs documentation ([19c3840](https://github.com/visulima/visulima/commit/19c384041db855e1c2de41ce2067458b39737565))
|
|
113
|
+
|
|
114
|
+
### Miscellaneous Chores
|
|
115
|
+
|
|
116
|
+
* **colorize:** update dependencies ([9da1353](https://github.com/visulima/visulima/commit/9da1353fc7c6c61b511ceb2988f5ae2a6a598d45))
|
|
117
|
+
* **colorize:** update dependencies ([1d995c9](https://github.com/visulima/visulima/commit/1d995c97607a5c95ac208758e957a62180e27072))
|
|
118
|
+
* move top-level examples into their respective packages ([3bf7105](https://github.com/visulima/visulima/commit/3bf7105a56db6383ae65d5e28dea9a2c18af791a))
|
|
119
|
+
* moved examples ([bb07290](https://github.com/visulima/visulima/commit/bb07290fba65a83aaad8f0ef62d1c244d1610002))
|
|
120
|
+
* **terminal:** update dependencies ([a5bb91a](https://github.com/visulima/visulima/commit/a5bb91a66f2be2ade485d586156a54c347a23cc9))
|
|
121
|
+
* update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
|
|
122
|
+
* year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
### Dependencies
|
|
126
|
+
|
|
127
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.5
|
|
128
|
+
|
|
129
|
+
## @visulima/colorize [2.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.3...@visulima/colorize@2.0.0-alpha.4) (2025-12-27)
|
|
130
|
+
|
|
131
|
+
### Bug Fixes
|
|
132
|
+
|
|
133
|
+
* **colorize:** update package files ([84c87a3](https://github.com/visulima/visulima/commit/84c87a3383cf370c94280319ac79ac106aaca3ec))
|
|
134
|
+
|
|
135
|
+
### Miscellaneous Chores
|
|
136
|
+
|
|
137
|
+
* fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
### Dependencies
|
|
141
|
+
|
|
142
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.4
|
|
143
|
+
|
|
144
|
+
## @visulima/colorize [2.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.2...@visulima/colorize@2.0.0-alpha.3) (2025-12-11)
|
|
145
|
+
|
|
146
|
+
### Bug Fixes
|
|
147
|
+
|
|
148
|
+
* update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
### Dependencies
|
|
152
|
+
|
|
153
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.3
|
|
154
|
+
|
|
155
|
+
## @visulima/colorize [2.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/colorize@2.0.0-alpha.1...@visulima/colorize@2.0.0-alpha.2) (2025-12-06)
|
|
156
|
+
|
|
157
|
+
### Bug Fixes
|
|
158
|
+
|
|
159
|
+
* add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
|
|
160
|
+
|
|
161
|
+
### Miscellaneous Chores
|
|
162
|
+
|
|
163
|
+
* update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
### Dependencies
|
|
167
|
+
|
|
168
|
+
* **@visulima/is-ansi-color-supported:** upgraded to 3.0.0-alpha.2
|
|
169
|
+
|
|
1
170
|
## @visulima/colorize [2.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/colorize@1.4.29...@visulima/colorize@2.0.0-alpha.1) (2025-12-05)
|
|
2
171
|
|
|
3
172
|
### ⚠ BREAKING CHANGES
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
<h3>Visulima Colorize</h3>
|
|
3
|
-
<p>
|
|
4
|
-
Terminal and Console string styling done right, powered by <a href="https://github.com/visulima/visulima/packages/is-ansi-color-supported">@visulima/is-ansi-color-supported</a>.
|
|
1
|
+
<!-- START_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
5
2
|
|
|
6
|
-
|
|
7
|
-
Elevate your terminal experience by effortlessly adding vibrant colors to your output with its clean and straightforward syntax.<br>
|
|
8
|
-
For instance, you can use `green` to make `` green`Hello World!` `` pop, `` red`Error!` `` to signify Errors, or `` black.bgYellow`Warning!` `` to highlight warnings.
|
|
3
|
+
<a href="https://www.anolilab.com/open-source" align="center">
|
|
9
4
|
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
<img src="__assets__/package-og.svg" alt="colorize" />
|
|
6
|
+
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<h3 align="center">Terminal and Console string styling done right.</h3>
|
|
10
|
+
|
|
11
|
+
<!-- END_PACKAGE_OG_IMAGE_PLACEHOLDER -->
|
|
12
12
|
|
|
13
13
|
<br />
|
|
14
14
|
|
|
15
15
|
<div align="center">
|
|
16
16
|
|
|
17
|
-
[![typescript-image]
|
|
17
|
+
[![typescript-image][typescript-badge]][typescript-url]
|
|
18
|
+
[![mit licence][license-badge]][license]
|
|
19
|
+
[![npm downloads][npm-downloads-badge]][npm-downloads]
|
|
20
|
+
[![Chat][chat-badge]][chat]
|
|
21
|
+
[![PRs Welcome][prs-welcome-badge]][prs-welcome]
|
|
18
22
|
|
|
19
23
|
</div>
|
|
20
24
|
|
|
@@ -919,25 +923,23 @@ Gradient:
|
|
|
919
923
|
- [tinygradient](https://github.com/mistic100/tinygradient) - Easily generate color gradients with an unlimited number of color stops and steps.
|
|
920
924
|
- [gradient-string](https://github.com/bokub/gradient-string) - Beautiful color gradients in terminal output
|
|
921
925
|
|
|
926
|
+
## Made with ❤️ at Anolilab
|
|
927
|
+
|
|
928
|
+
This is an open source project and will always remain free to use. If you think it's cool, please star it 🌟. [Anolilab](https://www.anolilab.com/open-source) is a Development and AI Studio. Contact us at [hello@anolilab.com](mailto:hello@anolilab.com) if you need any help with these technologies or just want to say hi!
|
|
929
|
+
|
|
922
930
|
## License
|
|
923
931
|
|
|
924
|
-
The visulima colorize is open-sourced software licensed under the [MIT][license
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
[
|
|
929
|
-
[license
|
|
930
|
-
[
|
|
931
|
-
[npm-
|
|
932
|
-
[
|
|
933
|
-
[
|
|
934
|
-
[
|
|
935
|
-
[
|
|
936
|
-
[
|
|
937
|
-
[
|
|
938
|
-
[ansi-colors]: https://github.com/doowb/ansi-colors
|
|
939
|
-
[kleur]: https://github.com/lukeed/kleur
|
|
940
|
-
[chalk]: https://github.com/chalk/chalk
|
|
941
|
-
[chalk-template]: https://github.com/chalk/chalk-template
|
|
942
|
-
[ansis]: https://github.com/webdiscus/ansis
|
|
943
|
-
[styleText]: https://nodejs.org/api/util.html#utilstyletextformat-text-options
|
|
932
|
+
The visulima colorize is open-sourced software licensed under the [MIT][license]
|
|
933
|
+
|
|
934
|
+
<!-- badges -->
|
|
935
|
+
|
|
936
|
+
[license-badge]: https://img.shields.io/npm/l/@visulima/colorize?style=for-the-badge
|
|
937
|
+
[license]: https://github.com/visulima/visulima/blob/main/LICENSE
|
|
938
|
+
[npm-downloads-badge]: https://img.shields.io/npm/dm/@visulima/colorize?style=for-the-badge
|
|
939
|
+
[npm-downloads]: https://www.npmjs.com/package/@visulima/colorize
|
|
940
|
+
[prs-welcome-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge
|
|
941
|
+
[prs-welcome]: https://github.com/visulima/visulima/blob/main/.github/CONTRIBUTING.md
|
|
942
|
+
[chat-badge]: https://img.shields.io/discord/932323359193186354.svg?style=for-the-badge
|
|
943
|
+
[chat]: https://discord.gg/TtFJY8xkFK
|
|
944
|
+
[typescript-badge]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
945
|
+
[typescript-url]: https://www.typescriptlang.org/
|
package/dist/gradient.cjs
CHANGED
|
@@ -1,60 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const colorize_server = require('./packem_shared/colorize.server-BA3gZZXz.cjs');
|
|
6
|
-
const GradientBuilder = require('./packem_shared/GradientBuilder-BXOgJeHi.cjs');
|
|
7
|
-
|
|
8
|
-
const colorize = new colorize_server.Colorize();
|
|
9
|
-
const forbiddenChars = /\s/g;
|
|
10
|
-
const gradient = (stops, options) => {
|
|
11
|
-
const { hsvSpin = "short", interpolation = "rgb" } = options ?? {};
|
|
12
|
-
let builder = new GradientBuilder.GradientBuilder(colorize, stops);
|
|
13
|
-
if (options?.loop) {
|
|
14
|
-
builder = builder.loop();
|
|
15
|
-
} else if (options?.reverse) {
|
|
16
|
-
builder = builder.reverse();
|
|
17
|
-
}
|
|
18
|
-
return (string_) => {
|
|
19
|
-
const colorsCount = Math.max(string_.replaceAll(forbiddenChars, "").length, builder.stops.length);
|
|
20
|
-
const colors = interpolation === "rgb" ? builder.rgb(colorsCount) : builder.hsv(colorsCount, hsvSpin);
|
|
21
|
-
let result = "";
|
|
22
|
-
for (const s of string_) {
|
|
23
|
-
if (forbiddenChars.test(s)) {
|
|
24
|
-
result += s;
|
|
25
|
-
} else {
|
|
26
|
-
const color = colors.shift();
|
|
27
|
-
result += color(s);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
const multilineGradient = (stops, options) => {
|
|
34
|
-
const { hsvSpin = "short", interpolation = "rgb" } = options ?? {};
|
|
35
|
-
let builder = new GradientBuilder.GradientBuilder(colorize, stops);
|
|
36
|
-
if (options?.loop) {
|
|
37
|
-
builder = builder.loop();
|
|
38
|
-
} else if (options?.reverse) {
|
|
39
|
-
builder = builder.reverse();
|
|
40
|
-
}
|
|
41
|
-
return (string_) => {
|
|
42
|
-
const lines = string_.split("\n");
|
|
43
|
-
const colorsCount = Reflect.apply(Math.max, null, [...lines.map((l) => l.length), builder.stops.length]);
|
|
44
|
-
const colors = interpolation === "rgb" ? builder.rgb(colorsCount) : builder.hsv(colorsCount, hsvSpin);
|
|
45
|
-
const results = [];
|
|
46
|
-
for (const line of lines) {
|
|
47
|
-
const lineColors = [...colors];
|
|
48
|
-
let lineResult = "";
|
|
49
|
-
for (const l of line) {
|
|
50
|
-
lineResult += forbiddenChars.test(l) ? l : lineColors.shift()(l);
|
|
51
|
-
}
|
|
52
|
-
results.push(lineResult);
|
|
53
|
-
}
|
|
54
|
-
return results.join("\n");
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
exports.GradientBuilder = GradientBuilder.GradientBuilder;
|
|
59
|
-
exports.gradient = gradient;
|
|
60
|
-
exports.multilineGradient = multilineGradient;
|
|
1
|
+
"use strict";var G=Object.defineProperty;var v=(r,t)=>G(r,"name",{value:t,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const B=require("./packem_shared/colorize.server-Dn-gV0MN.cjs"),g=require("./packem_shared/GradientBuilder-CudosKb8.cjs");var S=Object.defineProperty,f=v((r,t)=>S(r,"name",{value:t,configurable:!0}),"h");const b=new B.A,M=/\s/g,m=/\s/,j=f((r,t)=>{const{hsvSpin:a="short",interpolation:u="rgb"}=t??{};let e=new g.GradientBuilder(b,r);return t?.loop?e=e.loop():t?.reverse&&(e=e.reverse()),s=>{const l=s.replaceAll(M,""),i=Math.max(l.length,e.stops.length),c=u==="rgb"?e.rgb(i):e.hsv(i,a);let o="";for(const n of s)if(m.test(n))o+=n;else{const d=c.shift();o+=d(n)}return o}},"gradient"),w=f((r,t)=>{const{hsvSpin:a="short",interpolation:u="rgb"}=t??{};let e=new g.GradientBuilder(b,r);return t?.loop?e=e.loop():t?.reverse&&(e=e.reverse()),s=>{const l=s.split(`
|
|
2
|
+
`),i=Reflect.apply(Math.max,void 0,[...l.map(n=>n.length),e.stops.length]),c=u==="rgb"?e.rgb(i):e.hsv(i,a),o=[];for(const n of l){const d=[...c];let h="";for(const p of n)h+=m.test(p)?p:d.shift()(p);o.push(h)}return o.join(`
|
|
3
|
+
`)}},"multilineGradient");exports.GradientBuilder=g.GradientBuilder;exports.gradient=j;exports.multilineGradient=w;
|
package/dist/gradient.d.cts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { S as StopOutput, C as ColorizeType, a as ColorValueHex, b as CssColorName, R as RGB, c as StopInput } from "./packem_shared/types.d-bhP-2hCu.cjs";
|
|
2
|
+
declare class GradientBuilder {
|
|
3
|
+
#private;
|
|
4
|
+
readonly stops: StopOutput[];
|
|
5
|
+
constructor(colorize: ColorizeType, stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[]);
|
|
6
|
+
reverse(): GradientBuilder;
|
|
7
|
+
loop(): GradientBuilder;
|
|
8
|
+
rgb(steps: number): ColorizeType[];
|
|
9
|
+
hsv(steps: number, mode?: boolean | "long" | "short"): ColorizeType[];
|
|
10
|
+
}
|
|
11
|
+
declare const gradient: (stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[], options?: {
|
|
12
|
+
hsvSpin?: "long" | "short";
|
|
13
|
+
interpolation?: "hsv" | "rgb";
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
reverse?: boolean;
|
|
7
16
|
}) => (string_: string) => string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
declare const multilineGradient: (stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[], options?: {
|
|
18
|
+
hsvSpin?: "long" | "short";
|
|
19
|
+
interpolation?: "hsv" | "rgb";
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
reverse?: boolean;
|
|
13
22
|
}) => (string_: string) => string;
|
|
14
|
-
export { GradientBuilder
|
|
23
|
+
export { GradientBuilder, gradient, multilineGradient };
|
package/dist/gradient.d.mts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { S as StopOutput, C as ColorizeType, a as ColorValueHex, b as CssColorName, R as RGB, c as StopInput } from "./packem_shared/types.d-bhP-2hCu.mjs";
|
|
2
|
+
declare class GradientBuilder {
|
|
3
|
+
#private;
|
|
4
|
+
readonly stops: StopOutput[];
|
|
5
|
+
constructor(colorize: ColorizeType, stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[]);
|
|
6
|
+
reverse(): GradientBuilder;
|
|
7
|
+
loop(): GradientBuilder;
|
|
8
|
+
rgb(steps: number): ColorizeType[];
|
|
9
|
+
hsv(steps: number, mode?: boolean | "long" | "short"): ColorizeType[];
|
|
10
|
+
}
|
|
11
|
+
declare const gradient: (stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[], options?: {
|
|
12
|
+
hsvSpin?: "long" | "short";
|
|
13
|
+
interpolation?: "hsv" | "rgb";
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
reverse?: boolean;
|
|
7
16
|
}) => (string_: string) => string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
declare const multilineGradient: (stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[], options?: {
|
|
18
|
+
hsvSpin?: "long" | "short";
|
|
19
|
+
interpolation?: "hsv" | "rgb";
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
reverse?: boolean;
|
|
13
22
|
}) => (string_: string) => string;
|
|
14
|
-
export { GradientBuilder
|
|
23
|
+
export { GradientBuilder, gradient, multilineGradient };
|
package/dist/gradient.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { S as StopOutput, C as ColorizeType, a as ColorValueHex, b as CssColorName, R as RGB, c as StopInput } from "./packem_shared/types.d-bhP-2hCu.js";
|
|
2
|
+
declare class GradientBuilder {
|
|
3
|
+
#private;
|
|
4
|
+
readonly stops: StopOutput[];
|
|
5
|
+
constructor(colorize: ColorizeType, stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[]);
|
|
6
|
+
reverse(): GradientBuilder;
|
|
7
|
+
loop(): GradientBuilder;
|
|
8
|
+
rgb(steps: number): ColorizeType[];
|
|
9
|
+
hsv(steps: number, mode?: boolean | "long" | "short"): ColorizeType[];
|
|
10
|
+
}
|
|
11
|
+
declare const gradient: (stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[], options?: {
|
|
12
|
+
hsvSpin?: "long" | "short";
|
|
13
|
+
interpolation?: "hsv" | "rgb";
|
|
14
|
+
loop?: boolean;
|
|
15
|
+
reverse?: boolean;
|
|
7
16
|
}) => (string_: string) => string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
17
|
+
declare const multilineGradient: (stops: (ColorValueHex | CssColorName | RGB | StopInput | [number, number, number])[], options?: {
|
|
18
|
+
hsvSpin?: "long" | "short";
|
|
19
|
+
interpolation?: "hsv" | "rgb";
|
|
20
|
+
loop?: boolean;
|
|
21
|
+
reverse?: boolean;
|
|
13
22
|
}) => (string_: string) => string;
|
|
14
|
-
export { GradientBuilder
|
|
23
|
+
export { GradientBuilder, gradient, multilineGradient };
|
package/dist/gradient.mjs
CHANGED
|
@@ -1,54 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const colorize = new Colorize();
|
|
5
|
-
const forbiddenChars = /\s/g;
|
|
6
|
-
const gradient = (stops, options) => {
|
|
7
|
-
const { hsvSpin = "short", interpolation = "rgb" } = options ?? {};
|
|
8
|
-
let builder = new GradientBuilder(colorize, stops);
|
|
9
|
-
if (options?.loop) {
|
|
10
|
-
builder = builder.loop();
|
|
11
|
-
} else if (options?.reverse) {
|
|
12
|
-
builder = builder.reverse();
|
|
13
|
-
}
|
|
14
|
-
return (string_) => {
|
|
15
|
-
const colorsCount = Math.max(string_.replaceAll(forbiddenChars, "").length, builder.stops.length);
|
|
16
|
-
const colors = interpolation === "rgb" ? builder.rgb(colorsCount) : builder.hsv(colorsCount, hsvSpin);
|
|
17
|
-
let result = "";
|
|
18
|
-
for (const s of string_) {
|
|
19
|
-
if (forbiddenChars.test(s)) {
|
|
20
|
-
result += s;
|
|
21
|
-
} else {
|
|
22
|
-
const color = colors.shift();
|
|
23
|
-
result += color(s);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return result;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
const multilineGradient = (stops, options) => {
|
|
30
|
-
const { hsvSpin = "short", interpolation = "rgb" } = options ?? {};
|
|
31
|
-
let builder = new GradientBuilder(colorize, stops);
|
|
32
|
-
if (options?.loop) {
|
|
33
|
-
builder = builder.loop();
|
|
34
|
-
} else if (options?.reverse) {
|
|
35
|
-
builder = builder.reverse();
|
|
36
|
-
}
|
|
37
|
-
return (string_) => {
|
|
38
|
-
const lines = string_.split("\n");
|
|
39
|
-
const colorsCount = Reflect.apply(Math.max, null, [...lines.map((l) => l.length), builder.stops.length]);
|
|
40
|
-
const colors = interpolation === "rgb" ? builder.rgb(colorsCount) : builder.hsv(colorsCount, hsvSpin);
|
|
41
|
-
const results = [];
|
|
42
|
-
for (const line of lines) {
|
|
43
|
-
const lineColors = [...colors];
|
|
44
|
-
let lineResult = "";
|
|
45
|
-
for (const l of line) {
|
|
46
|
-
lineResult += forbiddenChars.test(l) ? l : lineColors.shift()(l);
|
|
47
|
-
}
|
|
48
|
-
results.push(lineResult);
|
|
49
|
-
}
|
|
50
|
-
return results.join("\n");
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export { GradientBuilder, gradient, multilineGradient };
|
|
1
|
+
var w=Object.defineProperty;var u=(r,e)=>w(r,"name",{value:e,configurable:!0});import{A as x}from"./packem_shared/colorize.server-BkQZGeaS.mjs";import{GradientBuilder as v}from"./packem_shared/GradientBuilder-Du8WSL23.mjs";var G=Object.defineProperty,m=u((r,e)=>G(r,"name",{value:e,configurable:!0}),"h");const b=new x,S=/\s/g,d=/\s/,M=m((r,e)=>{const{hsvSpin:p="short",interpolation:a="rgb"}=e??{};let t=new v(b,r);return e?.loop?t=t.loop():e?.reverse&&(t=t.reverse()),i=>{const l=i.replaceAll(S,""),s=Math.max(l.length,t.stops.length),c=a==="rgb"?t.rgb(s):t.hsv(s,p);let n="";for(const o of i)if(d.test(o))n+=o;else{const h=c.shift();n+=h(o)}return n}},"gradient"),B=m((r,e)=>{const{hsvSpin:p="short",interpolation:a="rgb"}=e??{};let t=new v(b,r);return e?.loop?t=t.loop():e?.reverse&&(t=t.reverse()),i=>{const l=i.split(`
|
|
2
|
+
`),s=Reflect.apply(Math.max,void 0,[...l.map(o=>o.length),t.stops.length]),c=a==="rgb"?t.rgb(s):t.hsv(s,p),n=[];for(const o of l){const h=[...c];let g="";for(const f of o)g+=d.test(f)?f:h.shift()(f);n.push(g)}return n.join(`
|
|
3
|
+
`)}},"multilineGradient");export{v as GradientBuilder,M as gradient,B as multilineGradient};
|