toolbox-x 1.0.0

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.
Files changed (190) hide show
  1. package/LICENSE +201 -0
  2. package/dist/Color-B3mgF9Dh.d.cts +486 -0
  3. package/dist/Color-D38Xrw65.d.mts +486 -0
  4. package/dist/Stylog-Df7eq3-j.d.cts +519 -0
  5. package/dist/Stylog-jvlLcMQq.d.mts +519 -0
  6. package/dist/array-DvW0zIu6.d.mts +130 -0
  7. package/dist/array-rUnEVisO.d.cts +130 -0
  8. package/dist/basics-D_eSv0cu.cjs +132 -0
  9. package/dist/basics-Dp_aEK81.mjs +115 -0
  10. package/dist/basics-WEYWlnRO.d.cts +95 -0
  11. package/dist/basics-uBSfkBEI.d.mts +95 -0
  12. package/dist/case-BWIt8Ash.mjs +449 -0
  13. package/dist/case-C-S-b5YP.d.cts +327 -0
  14. package/dist/case-CS8Ii3A7.cjs +526 -0
  15. package/dist/case-CybASFPD.d.mts +327 -0
  16. package/dist/change-case.cjs +32 -0
  17. package/dist/change-case.d.cts +18 -0
  18. package/dist/change-case.d.mts +18 -0
  19. package/dist/change-case.mjs +19 -0
  20. package/dist/colors.cjs +574 -0
  21. package/dist/colors.d.cts +355 -0
  22. package/dist/colors.d.mts +355 -0
  23. package/dist/colors.mjs +547 -0
  24. package/dist/constants-2gAw23_7.mjs +144 -0
  25. package/dist/constants-B34K0QPi.d.cts +21 -0
  26. package/dist/constants-BIBDKY1u.cjs +924 -0
  27. package/dist/constants-BWT-810U.cjs +158 -0
  28. package/dist/constants-BwbHnXlM.mjs +662 -0
  29. package/dist/constants-BxN9l5el.cjs +74 -0
  30. package/dist/constants-CLS_bgKD.d.mts +847 -0
  31. package/dist/constants-D73iFu8g.mjs +171 -0
  32. package/dist/constants-DAfRxaa8.mjs +62 -0
  33. package/dist/constants-DQYeCjlx.cjs +207 -0
  34. package/dist/constants-Deeie-iH.d.mts +21 -0
  35. package/dist/constants-DpTG9RP6.d.mts +29 -0
  36. package/dist/constants-DqwnkJ_d.cjs +740 -0
  37. package/dist/constants-DvRUY_FY.cjs +150 -0
  38. package/dist/constants-VcRtQu0K.d.cts +29 -0
  39. package/dist/constants-X5hm1UtB.mjs +912 -0
  40. package/dist/constants-eNd-iYsV.mjs +134 -0
  41. package/dist/constants-qm8FafmD.d.cts +847 -0
  42. package/dist/constants.cjs +415 -0
  43. package/dist/constants.d.cts +184 -0
  44. package/dist/constants.d.mts +184 -0
  45. package/dist/constants.mjs +378 -0
  46. package/dist/convert-BOCgUv2D.cjs +252 -0
  47. package/dist/convert-Bn4jFomQ.mjs +169 -0
  48. package/dist/convert-BrzlG-m_.cjs +475 -0
  49. package/dist/convert-DhaUoPVU.mjs +368 -0
  50. package/dist/converter-1P90_RcP.d.mts +402 -0
  51. package/dist/converter-CmkcAppi.d.cts +402 -0
  52. package/dist/converter.cjs +780 -0
  53. package/dist/converter.d.cts +29 -0
  54. package/dist/converter.d.mts +29 -0
  55. package/dist/converter.mjs +771 -0
  56. package/dist/countries-CIpmtEzV.cjs +1469 -0
  57. package/dist/countries-Cy0xiqS3.mjs +1463 -0
  58. package/dist/css-colors-Bx947Ng3.d.cts +179 -0
  59. package/dist/css-colors-CXCDqQbG.cjs +186 -0
  60. package/dist/css-colors-CXTp1vvy.d.mts +179 -0
  61. package/dist/css-colors-DfUW3nTR.mjs +180 -0
  62. package/dist/date.cjs +332 -0
  63. package/dist/date.d.cts +213 -0
  64. package/dist/date.d.mts +213 -0
  65. package/dist/date.mjs +298 -0
  66. package/dist/dom.cjs +461 -0
  67. package/dist/dom.d.cts +228 -0
  68. package/dist/dom.d.mts +228 -0
  69. package/dist/dom.mjs +429 -0
  70. package/dist/form-BMFVGUrN.d.mts +118 -0
  71. package/dist/form-DRFbryvK.d.cts +118 -0
  72. package/dist/guards-3kaUX66g.mjs +157 -0
  73. package/dist/guards-C8gkvIHb.cjs +240 -0
  74. package/dist/guards-DdyU4h4o.mjs +110 -0
  75. package/dist/guards-Efhp1mNy.cjs +151 -0
  76. package/dist/guards.cjs +172 -0
  77. package/dist/guards.d.cts +399 -0
  78. package/dist/guards.d.mts +399 -0
  79. package/dist/guards.mjs +75 -0
  80. package/dist/hash-B6JPEyAz.d.mts +131 -0
  81. package/dist/hash-NTpeKYB_.d.cts +131 -0
  82. package/dist/hash.cjs +2126 -0
  83. package/dist/hash.d.cts +1239 -0
  84. package/dist/hash.d.mts +1239 -0
  85. package/dist/hash.mjs +2095 -0
  86. package/dist/http-status-BAZdtr7-.d.mts +65 -0
  87. package/dist/http-status-U_3MtoGb.d.cts +65 -0
  88. package/dist/http-status.cjs +173 -0
  89. package/dist/http-status.d.cts +142 -0
  90. package/dist/http-status.d.mts +142 -0
  91. package/dist/http-status.mjs +171 -0
  92. package/dist/index.cjs +2551 -0
  93. package/dist/index.d.cts +1493 -0
  94. package/dist/index.d.mts +1493 -0
  95. package/dist/index.mjs +2357 -0
  96. package/dist/object-B0TV3eHx.d.mts +8052 -0
  97. package/dist/object-Blq0Amdv.d.cts +8052 -0
  98. package/dist/objectify-CDs0Fbr1.mjs +417 -0
  99. package/dist/objectify-DIJ-OBmo.cjs +524 -0
  100. package/dist/paginator.cjs +245 -0
  101. package/dist/paginator.d.cts +144 -0
  102. package/dist/paginator.d.mts +144 -0
  103. package/dist/paginator.mjs +243 -0
  104. package/dist/parse-2ubxXZRp.cjs +211 -0
  105. package/dist/parse-N7g942uy.mjs +164 -0
  106. package/dist/pluralizer-BjMIc6uT.d.mts +42 -0
  107. package/dist/pluralizer-Cb6ZmrDl.d.cts +42 -0
  108. package/dist/pluralizer.cjs +678 -0
  109. package/dist/pluralizer.d.cts +152 -0
  110. package/dist/pluralizer.d.mts +152 -0
  111. package/dist/pluralizer.mjs +676 -0
  112. package/dist/primitives-B26uZolQ.cjs +228 -0
  113. package/dist/primitives-KsFUp3kQ.mjs +144 -0
  114. package/dist/specials-D48_IZbd.d.mts +108 -0
  115. package/dist/specials-DzLr1ZgU.cjs +477 -0
  116. package/dist/specials-LVONlKbQ.d.cts +108 -0
  117. package/dist/specials-uhDuRg8H.mjs +292 -0
  118. package/dist/string-CBAbxaG1.d.mts +258 -0
  119. package/dist/string-CsNsm_65.d.cts +258 -0
  120. package/dist/stylog.cjs +621 -0
  121. package/dist/stylog.d.cts +49 -0
  122. package/dist/stylog.d.mts +49 -0
  123. package/dist/stylog.mjs +614 -0
  124. package/dist/timezone-B2OYK6Fh.mjs +5589 -0
  125. package/dist/timezone-Beh9IGpw.cjs +5625 -0
  126. package/dist/types/array.cjs +16 -0
  127. package/dist/types/array.d.cts +18 -0
  128. package/dist/types/array.d.mts +18 -0
  129. package/dist/types/array.mjs +17 -0
  130. package/dist/types/colors.cjs +16 -0
  131. package/dist/types/colors.d.cts +18 -0
  132. package/dist/types/colors.d.mts +18 -0
  133. package/dist/types/colors.mjs +17 -0
  134. package/dist/types/converter.cjs +16 -0
  135. package/dist/types/converter.d.cts +18 -0
  136. package/dist/types/converter.d.mts +18 -0
  137. package/dist/types/converter.mjs +17 -0
  138. package/dist/types/form.cjs +16 -0
  139. package/dist/types/form.d.cts +18 -0
  140. package/dist/types/form.d.mts +18 -0
  141. package/dist/types/form.mjs +17 -0
  142. package/dist/types/hash.cjs +16 -0
  143. package/dist/types/hash.d.cts +18 -0
  144. package/dist/types/hash.d.mts +18 -0
  145. package/dist/types/hash.mjs +17 -0
  146. package/dist/types/http-status.cjs +16 -0
  147. package/dist/types/http-status.d.cts +18 -0
  148. package/dist/types/http-status.d.mts +18 -0
  149. package/dist/types/http-status.mjs +17 -0
  150. package/dist/types/index.cjs +16 -0
  151. package/dist/types/index.d.cts +18 -0
  152. package/dist/types/index.d.mts +18 -0
  153. package/dist/types/index.mjs +17 -0
  154. package/dist/types/number.cjs +16 -0
  155. package/dist/types/number.d.cts +18 -0
  156. package/dist/types/number.d.mts +18 -0
  157. package/dist/types/number.mjs +17 -0
  158. package/dist/types/object.cjs +16 -0
  159. package/dist/types/object.d.cts +18 -0
  160. package/dist/types/object.d.mts +18 -0
  161. package/dist/types/object.mjs +17 -0
  162. package/dist/types/pluralizer.cjs +16 -0
  163. package/dist/types/pluralizer.d.cts +18 -0
  164. package/dist/types/pluralizer.d.mts +18 -0
  165. package/dist/types/pluralizer.mjs +17 -0
  166. package/dist/types/string.cjs +16 -0
  167. package/dist/types/string.d.cts +18 -0
  168. package/dist/types/string.d.mts +18 -0
  169. package/dist/types/string.mjs +17 -0
  170. package/dist/types/stylog.cjs +16 -0
  171. package/dist/types/stylog.d.cts +18 -0
  172. package/dist/types/stylog.d.mts +18 -0
  173. package/dist/types/stylog.mjs +17 -0
  174. package/dist/types/utils.cjs +16 -0
  175. package/dist/types/utils.d.cts +18 -0
  176. package/dist/types/utils.d.mts +18 -0
  177. package/dist/types/utils.mjs +17 -0
  178. package/dist/types/verbalizer.cjs +16 -0
  179. package/dist/types/verbalizer.d.cts +30 -0
  180. package/dist/types/verbalizer.d.mts +30 -0
  181. package/dist/types/verbalizer.mjs +17 -0
  182. package/dist/utilities-CLUmdQeV.cjs +140 -0
  183. package/dist/utilities-m5yFKqLd.mjs +105 -0
  184. package/dist/utils-ClW9LA6f.mjs +449 -0
  185. package/dist/utils-DLFRgXUC.cjs +568 -0
  186. package/dist/verbalizer.cjs +998 -0
  187. package/dist/verbalizer.d.cts +148 -0
  188. package/dist/verbalizer.d.mts +148 -0
  189. package/dist/verbalizer.mjs +996 -0
  190. package/package.json +249 -0
@@ -0,0 +1,355 @@
1
+ /**
2
+ * Copyright 2026 - present Nazmul Hassan
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+
17
+ import { rn as Percent } from "./object-B0TV3eHx.mjs";
18
+ import { C as RandomColorOptions, E as SolidValues, S as RandomColor, _ as Hex, a as AlphaValues, b as RGB, g as HSLA, h as HSL, l as ColorInputArray, n as $ColorType, t as Color, v as Hex6, w as RandomHexRGB, x as RGBA, y as Hex8 } from "./Color-D38Xrw65.mjs";
19
+
20
+ //#region src/colors/convert.d.ts
21
+ /**
22
+ * * Converts HSL to RGB color format.
23
+ *
24
+ * @param h - The hue component of the HSL color, in degrees (0 to 360).
25
+ * @param s - The saturation component of the HSL color, as a percentage (0 to 100).
26
+ * @param l - The lightness component of the HSL color, as a percentage (0 to 100).
27
+ * @returns A string representing the color in RGB format (e.g., `rgb(255, 0, 0)`).
28
+ */
29
+ declare const convertHslToRgb: (h: number, s: number, l: number) => RGB;
30
+ /**
31
+ * * Converts RGB to HSL color format.
32
+ *
33
+ * @param r - The red component of the RGB color, in the range 0 to 255.
34
+ * @param g - The green component of the RGB color, in the range 0 to 255.
35
+ * @param b - The blue component of the RGB color, in the range 0 to 255.
36
+ * @returns A string representing the color in HSL format (e.g., `hsl(0, 100%, 50%)`).
37
+ */
38
+ declare const convertRgbToHsl: (r: number, g: number, b: number) => HSL;
39
+ /**
40
+ * * Converts HSL to Hex color format.
41
+ *
42
+ * @param h - The hue component of the HSL color, in degrees (0 to 360).
43
+ * @param s - The saturation component of the HSL color, as a percentage (0 to 100).
44
+ * @param l - The lightness component of the HSL color, as a percentage (0 to 100).
45
+ * @returns A string representing the color in Hex format (e.g., `#FF0000`).
46
+ */
47
+ declare const convertHslToHex: (h: number, s: number, l: number) => Hex6;
48
+ /**
49
+ * * Converts Hex to HSL color format.
50
+ *
51
+ * @param hex - A string representing the color in Hex format (e.g., `#FF0000`).
52
+ * @returns A string representing the color in HSL format (e.g., `hsl(0, 100%, 50%)`).
53
+ */
54
+ declare const convertHexToHsl: (hex: Hex6 | Hex) => HSL;
55
+ /**
56
+ * * Converts RGB to Hex color format.
57
+ *
58
+ * @param r - The red component of the RGB color, in the range 0 to 255.
59
+ * @param g - The green component of the RGB color, in the range 0 to 255.
60
+ * @param b - The blue component of the RGB color, in the range 0 to 255.
61
+ * @returns A string representing the color in Hex format (e.g., `#FF0000`).
62
+ */
63
+ declare const convertRgbToHex: (r: number, g: number, b: number) => Hex6;
64
+ /**
65
+ * * Converts Hex to RGB color format.
66
+ *
67
+ * @param hex - A string representing the color in Hex format (e.g., `#FF0000`).
68
+ * @returns A string representing the color in RGB format (e.g., `rgb(255, 0, 0)`).
69
+ */
70
+ declare const convertHexToRgb: (hex: Hex6 | Hex | string) => RGB;
71
+ /**
72
+ * * Converts RGB to RGBA format, adding alpha (opacity).
73
+ *
74
+ * @param r - The red component of the RGB color, in the range 0 to 255.
75
+ * @param g - The green component of the RGB color, in the range 0 to 255.
76
+ * @param b - The blue component of the RGB color, in the range 0 to 255.
77
+ * @param a - The alpha (opacity) value, in the range 0 to 1.
78
+ * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).
79
+ */
80
+ declare const convertRgbToRgba: (r: number, g: number, b: number, a?: number) => RGBA;
81
+ /**
82
+ * * Converts RGBA to Hex format, including alpha channel as part of Hex8.
83
+ *
84
+ * @param r - The red component of the RGB color, in the range 0 to 255.
85
+ * @param g - The green component of the RGB color, in the range 0 to 255.
86
+ * @param b - The blue component of the RGB color, in the range 0 to 255.
87
+ * @param a - The alpha (opacity) value, in the range 0 to 1.
88
+ * @returns A string representing the color in Hex8 format (e.g., `#FF000080`).
89
+ */
90
+ declare const convertRgbaToHex8: (r: number, g: number, b: number, a?: number) => Hex8;
91
+ /**
92
+ * * Converts HSLA to RGBA color format, including alpha channel.
93
+ *
94
+ * @param h - The hue component of the HSL color, in degrees (0 to 360).
95
+ * @param s - The saturation component of the HSL color, as a percentage (0 to 100).
96
+ * @param l - The lightness component of the HSL color, as a percentage (0 to 100).
97
+ * @param a - The alpha (opacity) value, in the range 0 to 1.
98
+ * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).
99
+ */
100
+ declare const convertHslaToRgba: (h: number, s: number, l: number, a?: number) => RGBA;
101
+ /**
102
+ * * Converts RGBA to HSLA color format, including alpha channel.
103
+ *
104
+ * @param r - The red component of the RGB color, in the range 0 to 255.
105
+ * @param g - The green component of the RGB color, in the range 0 to 255.
106
+ * @param b - The blue component of the RGB color, in the range 0 to 255.
107
+ * @param a - The alpha (opacity) value, in the range 0 to 1.
108
+ * @returns A string representing the color in HSLA format (e.g., `hsla(0, 100%, 50%, 0.5)`).
109
+ */
110
+ declare const convertRgbaToHsla: (r: number, g: number, b: number, a?: number) => HSLA;
111
+ /**
112
+ * * Converts Hex8 to RGBA color format, including alpha channel.
113
+ * - `Special Note:` Cast the parameter to `Hex8` before converting to `RGBA`.
114
+ * @example convertHex8ToRgba('#FFF122DE' as Hex8)
115
+ *
116
+ * @param hex8 - A string representing the color in Hex8 format (e.g., `#FF000080`).
117
+ * @returns A string representing the color in RGBA format (e.g., `rgba(255, 0, 0, 0.5)`).
118
+ */
119
+ declare const convertHex8ToRgba: (hex8: Hex8) => RGBA;
120
+ /**
121
+ * * Converts HSLA to Hex8 color format, including alpha channel.
122
+ *
123
+ * @param h - The hue component of the HSL color, in degrees (0 to 360).
124
+ * @param s - The saturation component of the HSL color, as a percentage (0 to 100).
125
+ * @param l - The lightness component of the HSL color, as a percentage (0 to 100).
126
+ * @param a - The alpha (opacity) value, in the range 0 to 1.
127
+ * @returns A string representing the color in Hex8 format (e.g., `#658789DF`).
128
+ */
129
+ declare const convertHslaToHex8: (h: number, s: number, l: number, a?: number) => Hex8;
130
+ /**
131
+ * * Converts Hex8 to HSLA color format.
132
+ * - `Special Note:` Cast the parameter to `Hex8` before converting to `HSLA`.
133
+ * @example convertHex8ToHsla('#FFF122DE' as Hex8)
134
+ *
135
+ * @param hex - A string representing the color in Hex format (e.g., `#FF0000DE`).
136
+ * @returns A string representing the color in HSLA format..
137
+ */
138
+ declare const convertHex8ToHsla: (hex8: Hex8) => HSLA;
139
+ /**
140
+ * * Converts a `Hex` color code to `RGB` and `HSL` formats.
141
+ * - `Special Note:` Cast the parameter to `Hex6` before converting to `RGB` and `HSL`.
142
+ * @example convertColorCode('#FFF122' as Hex6)
143
+ *
144
+ * @param color The `Hex` color code (e.g., `#3c6945`).
145
+ * @returns An object containing the `RGB` and `HSL` formats of the given `Hex` color.
146
+ */
147
+ declare function convertColorCode(color: Hex6): {
148
+ rgb: RGB;
149
+ hsl: HSL;
150
+ };
151
+ /**
152
+ * * Converts an `RGB` color to `Hex` and `HSL` formats.
153
+ *
154
+ * @param color The `RGB` color string (e.g., `rgb(60, 105, 69)`).
155
+ * @returns An object containing the `Hex` and `HSL` formats of the given `RGB` color.
156
+ */
157
+ declare function convertColorCode(color: RGB): {
158
+ hex: Hex6;
159
+ hsl: HSL;
160
+ };
161
+ /**
162
+ * * Converts an `HSL` color to `Hex` and `RGB` formats.
163
+ *
164
+ * @param color The `HSL` color string (e.g., `hsl(132, 27.27%, 32.35%)`).
165
+ * @returns An object containing the `Hex` and `RGB` formats of the given `HSL` color.
166
+ */
167
+ declare function convertColorCode(color: HSL): {
168
+ hex: Hex6;
169
+ rgb: RGB;
170
+ };
171
+ /**
172
+ * * Converts a `Hex8` color code to `RGB` and `HSL` formats.
173
+ * - `Special Note:` Cast the parameter to `Hex8` before converting to `RGBA` and `HSLA`.
174
+ * @example convertColorCode('#FFF122DE' as Hex8)
175
+ *
176
+ * @param color The `Hex8` color code (e.g., `#3c6945`).
177
+ * @returns An object containing the `RGB` and `HSL` formats of the given `Hex8` color.
178
+ */
179
+ declare function convertColorCode(color: Hex8): {
180
+ rgba: RGBA;
181
+ hsla: HSLA;
182
+ };
183
+ /**
184
+ * * Converts an `RGBA` color to `Hex8` and `HSLA` formats.
185
+ *
186
+ * @param color The `RGBA` color string (e.g., `rgb(60, 105, 69)`).
187
+ * @returns An object containing the `Hex8` and `HSLA` formats of the given `RGBA` color.
188
+ */
189
+ declare function convertColorCode(color: RGBA): {
190
+ hex8: Hex8;
191
+ hsla: HSLA;
192
+ };
193
+ /**
194
+ * * Converts an `HSLA` color to `Hex8` and `RGBA` formats.
195
+ *
196
+ * @param color The `HSLA` color string (e.g., `hsl(132, 27.27%, 32.35%)`).
197
+ * @returns An object containing the `Hex8` and `RGBA` formats of the given `HSLA` color.
198
+ */
199
+ declare function convertColorCode(color: HSLA): {
200
+ hex8: Hex8;
201
+ rgba: RGBA;
202
+ };
203
+ //#endregion
204
+ //#region src/colors/initials.d.ts
205
+ /**
206
+ * * Generates a hex (`Hex8` format) color based on the first character (initial) of a string or number.
207
+ *
208
+ * - For numbers, it uses 10 predefined colors (0-9).
209
+ * - For letters, it uses 26 predefined colors (A-Z).
210
+ * - Invalid characters handled with a fallback color.
211
+ * @param input - A string or number.
212
+ * @param opacity - A value from 0 to 100 representing the opacity percentage.
213
+ * @returns A hex color for the first character of the provided string/number.
214
+ */
215
+ declare function getColorForInitial(input: string | number, opacity?: Percent): Hex8;
216
+ /**
217
+ * * Generates an array of hex (`Hex8` format) colors based on the first character (initial) of an array of strings/numbers or even nested arrays of strings/numbers.
218
+ *
219
+ * - For numbers, it uses 10 predefined colors (0-9).
220
+ * - For letters, it uses 26 predefined colors (A-Z).
221
+ * - For empty array it returns all 36 colors.
222
+ * - Invalid characters and inputs are handled with a fallback color.
223
+ * @param input - A string, number, or an array of strings/numbers or even nested arrays of strings/numbers.
224
+ * @param opacity - A value from 0 to 100 representing the opacity percentage.
225
+ * @returns A hex color for a string/number, or an array of hex colors for each element of the provided array.
226
+ */
227
+ declare function getColorForInitial(input: ColorInputArray, opacity?: Percent): Hex8[];
228
+ //#endregion
229
+ //#region src/colors/random.d.ts
230
+ /**
231
+ * * Utility to generate a unique random HSL color.
232
+ *
233
+ * @param maxColors - The maximum number of recent colors to store in memory. Default is `16`.
234
+ * @returns Generated unique random color in `HSL` format.
235
+ */
236
+ declare const generateRandomHSLColor: (maxColors?: number) => HSL;
237
+ /**
238
+ * @deprecated For optimized performance and more flexibility, please consider using {@link generateRandomColor}.
239
+ *
240
+ * * Utility to generate a unique random color in `Hex6` and `RGB` format.
241
+ *
242
+ * @param maxColors - The maximum number of recent colors to store in memory. Default is `16`.
243
+ * @returns An object of generated unique random color in both `Hex` and `RGB` formats.
244
+ */
245
+ declare const generateRandomColorInHexRGB: (maxColors?: number) => RandomHexRGB;
246
+ /**
247
+ * * Generates a random unique color in one of three formats: `Hex6`, `RGB`, or `HSL`.
248
+ *
249
+ * @remarks
250
+ * - If no `options` or `colorType` option is provided, the function defaults to returning a color in `Hex6` format.
251
+ * - The `colorType` option determines the return type:
252
+ * - `'hex'` → returns a `Hex6` string e.g. `'#34E2EF'`
253
+ * - `'rgb'` → returns an `RGB` string e.g. `'hsl(223, 96%, 53%)'`
254
+ * - `'hsl'` → returns an `HSL` string e.g. `'rgb(235, 159, 45)'`
255
+ * - The `maxColors` option controls how many recently generated colors are kept in memory to prevent repetition.
256
+ * By default, this value is `16`. Increasing it allows more unique color variations before repeating.
257
+ *
258
+ * @param options - Configuration options for random color generation, including `colorType` and `maxColors`.
259
+ * @returns A random unique color in the specified format (`Hex6`, `RGB`, or `HSL`).
260
+ *
261
+ * @example
262
+ * const hex = generateRandomColor();
263
+ * // hex value with inferred type: Hex6
264
+ *
265
+ * const rgb = generateRandomColor({ colorType: 'rgb' });
266
+ * // rgb value with inferred type: RGB
267
+ *
268
+ * const hsl = generateRandomColor({ colorType: 'hsl', maxColors: 32 });
269
+ * // hsl value with inferred type: HSL, with a larger unique color memory pool
270
+ */
271
+ declare function generateRandomColor<C extends $ColorType = 'hex'>(options?: RandomColorOptions<C>): RandomColor<C>;
272
+ //#endregion
273
+ //#region src/colors/utils.d.ts
274
+ /**
275
+ * * Extracts numbers from a color string like `rgb(66, 103, 69)` or `hsl(120, 42.86%, 41.18%)`.
276
+ * * Converts percentage values to decimal (e.g., `42.86%` → `42.86`).
277
+ *
278
+ * @param color The color string in RGB or HSL format.
279
+ * @returns A tuple of 3 extracted numbers. `[number, number, number]`
280
+ *
281
+ * @remarks If the input color is not in `HSL` or `RGB` format, it will return `[0, 0, 0]`
282
+ */
283
+ declare function extractSolidColorValues(color: HSL | RGB): SolidValues;
284
+ /**
285
+ * * Extracts numbers from a color string like `rgba(66, 103, 69, 0.6)` or `hsla(120, 42.86%, 41.18%, 0.9)`.
286
+ * * Converts percentage values to decimal (e.g., `42.86%` → `42.86`).
287
+ *
288
+ * @param color The color string in RGBA or HSLA format.
289
+ * @returns A tuple of 4 extracted numbers. `[number, number, number, number]`
290
+ *
291
+ * @remarks If the input color is not in `HSLA` or `RGBA` format, it will return `[0, 0, 0, 0]`
292
+ */
293
+ declare function extractAlphaColorValues(color: HSLA | RGBA): AlphaValues;
294
+ /**
295
+ * * Converts percentage (0-100) to a 2-digit hex string.
296
+ *
297
+ * @param percent - The percentage (0-100) value.
298
+ * @returns A 2-digit hex string representing the percentage (0-100) value.
299
+ *
300
+ * @remarks
301
+ * - This function ensures that the percentage value is clamped between 0 and 100, converts it to a value between 0 and 255, and then formats it as a 2-digit hexadecimal string.
302
+ * - The resulting hex string is in uppercase for consistency with common hex color formats.
303
+ *
304
+ * @example
305
+ * percentToHex(0); // Returns "00"
306
+ * percentToHex(50); // Returns "7F"
307
+ * percentToHex(100); // Returns "FF"
308
+ * percentToHex(150); // Returns "FF" (ts compiler error and clamped to 100)
309
+ * percentToHex(-20); // Returns "00" (ts compiler error and clamped to 0)
310
+ */
311
+ declare function percentToHex(percent: Percent): string;
312
+ /**
313
+ * * Applies an opacity value to a hex color string.
314
+ *
315
+ * @param color - The hex color string in the format `#RRGGBB` or `#RRGGBBAA`.
316
+ * @param opacity - The opacity value as a percentage (0-100).
317
+ * @returns The hex color string with the applied opacity in `#RRGGBBAA` format.
318
+ *
319
+ * @throws - {@link TypeError} If the provided color is not a valid hex color string.
320
+ *
321
+ * @remarks
322
+ * - If the input color is in `#RRGGBB` format, the function will append the opacity value to create a `#RRGGBBAA` string.
323
+ * - If the input color is already in `#RRGGBBAA` format, it will replace the existing alpha value with the new one.
324
+ * - The function validates that the input color is a valid hex color string and that the opacity value is a valid percentage before applying the opacity.
325
+ * - If the opacity value is invalid, it defaults to 100% opacity (i.e., "FF").
326
+ * - The resulting hex color string is in uppercase for consistency with common hex color formats.
327
+ *
328
+ * @example
329
+ * applyOpacityToHex("#FF5733", 50); // Returns "#FF573380"
330
+ * applyOpacityToHex("#FF573380", 25); // Returns "#FF573340"
331
+ */
332
+ declare function applyOpacityToHex(color: Hex, opacity: Percent): Hex8;
333
+ /**
334
+ * * Applies an opacity value to a hex color string.
335
+ *
336
+ * @param color - The hex color string in the format `#RRGGBB` or `#RRGGBBAA`.
337
+ * @param opacity - The opacity value as a 2-digit hex string.
338
+ * @returns The hex color string with the applied opacity in `#RRGGBBAA` format.
339
+ *
340
+ * @throws - {@link TypeError} If the provided color is not a valid hex color string.
341
+ *
342
+ * @remarks
343
+ * - If the input color is in `#RRGGBB` format, the function will append the opacity value to create a `#RRGGBBAA` string.
344
+ * - If the input color is already in `#RRGGBBAA` format, it will replace the existing alpha value with the new one.
345
+ * - The function validates that the input color is a valid hex color string and that the opacity value is a valid a 2-digit hex string before applying the opacity.
346
+ * - If the opacity value is invalid, it defaults to 100% opacity (i.e., "FF").
347
+ * - The resulting hex color string is in uppercase for consistency with common hex color formats.
348
+ *
349
+ * @example
350
+ * applyOpacityToHex("#FF5733", "80"); // Returns "#FF573380"
351
+ * applyOpacityToHex("#FF573380", "40"); // Returns "#FF573340"
352
+ */
353
+ declare function applyOpacityToHex(color: Hex, opacity: string): Hex8;
354
+ //#endregion
355
+ export { Color, Color as Colour, applyOpacityToHex, convertColorCode, convertHex8ToHsla, convertHex8ToRgba, convertHexToHsl, convertHexToRgb, convertHslToHex, convertHslToRgb, convertHslaToHex8, convertHslaToRgba, convertRgbToHex, convertRgbToHsl, convertRgbToRgba, convertRgbaToHex8, convertRgbaToHsla, extractAlphaColorValues, extractSolidColorValues, generateRandomColor, generateRandomColor as getRandomColor, generateRandomColorInHexRGB, generateRandomHSLColor as generateRandomHSL, generateRandomHSLColor, generateRandomHSLColor as getRandomHSL, getColorForInitial, percentToHex };