dozy 1.0.32 → 1.0.33
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/dist/assets/reset.d.ts +1 -0
- package/dist/index.d.ts +47 -1
- package/dist/index.js +18 -18
- package/dist/index.js.map +3 -3
- package/dist/modules/Color.d.ts +41 -0
- package/dist/modules/Color.d.ts.map +1 -1
- package/package.json +5 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -236,7 +236,53 @@ export declare function smartString(input: string | any, fallback?: string): str
|
|
|
236
236
|
* Check if a color string is valid (smartly).
|
|
237
237
|
*/
|
|
238
238
|
export declare function isValidColor(input: string): boolean;
|
|
239
|
-
|
|
239
|
+
/**
|
|
240
|
+
* Calculates the brightness of a color.
|
|
241
|
+
* Uses the Rec. 601 luma formula: (R * 299 + G * 587 + B * 114) / 1000.
|
|
242
|
+
* Returns a value between 0 (black) and 1 (white).
|
|
243
|
+
*
|
|
244
|
+
* @param input The color to check.
|
|
245
|
+
* @returns The brightness value (0-1), or 0 if invalid.
|
|
246
|
+
*/
|
|
247
|
+
export declare function getBrightness(input: string | any): number;
|
|
248
|
+
/**
|
|
249
|
+
* Converts a color to an RGBA array [r, g, b, a].
|
|
250
|
+
* RGB values are 0-255, Alpha is 0-1.
|
|
251
|
+
*
|
|
252
|
+
* @param input The color to convert.
|
|
253
|
+
* @returns [r, g, b, a] or undefined if invalid.
|
|
254
|
+
*/
|
|
255
|
+
export declare function toRgbaArray(input: string | any): [
|
|
256
|
+
number,
|
|
257
|
+
number,
|
|
258
|
+
number,
|
|
259
|
+
number
|
|
260
|
+
] | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Converts a color to a Hex string.
|
|
263
|
+
* @param input The color.
|
|
264
|
+
* @returns Hex string (e.g. #ff0000) or undefined.
|
|
265
|
+
*/
|
|
266
|
+
export declare function toHexString(input: string | any): string | undefined;
|
|
267
|
+
/**
|
|
268
|
+
* Converts a color to an RGB/RGBA string.
|
|
269
|
+
* Uses modern comma-separated syntax for compatibility if preferred, or standard CSS.
|
|
270
|
+
* Note: culori's formatRgb might use space-separated syntax (CSS Color 4).
|
|
271
|
+
* This function forces comma-separated legacy syntax: rgb(r, g, b) or rgba(r, g, b, a).
|
|
272
|
+
*
|
|
273
|
+
* @param input The color.
|
|
274
|
+
* @returns RGB/RGBA string or undefined.
|
|
275
|
+
*/
|
|
276
|
+
export declare function toRgbString(input: string | any): string | undefined;
|
|
277
|
+
/**
|
|
278
|
+
* Converts a color to an HSL/HSLA string.
|
|
279
|
+
* Forces legacy comma-separated syntax: hsl(h, s%, l%) or hsla(h, s%, l%, a).
|
|
280
|
+
*
|
|
281
|
+
* @param input The color.
|
|
282
|
+
* @returns HSL/HSLA string or undefined.
|
|
283
|
+
*/
|
|
284
|
+
export declare function toHslString(input: string | any): string | undefined;
|
|
285
|
+
export declare const DOZY = "1.0.33";
|
|
240
286
|
export * from "axios";
|
|
241
287
|
export * from "zod";
|
|
242
288
|
|