@kurkle/color 0.3.4 → 0.5.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.
- package/README.md +13 -1
- package/dist/byte.d.ts +35 -0
- package/dist/color.cjs +460 -328
- package/dist/color.cjs.map +7 -0
- package/dist/color.d.ts +55 -155
- package/dist/color.esm.js +431 -295
- package/dist/color.esm.js.map +7 -0
- package/dist/color.min.js +3 -3
- package/dist/color.min.js.map +7 -1
- package/dist/hex.d.ts +16 -0
- package/dist/hue.d.ts +53 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.esm.d.ts +18 -0
- package/dist/names.d.ts +11 -0
- package/dist/packed.d.ts +9 -0
- package/dist/rgb.d.ts +16 -0
- package/dist/srgb.d.ts +12 -0
- package/package.json +26 -35
package/README.md
CHANGED
|
@@ -66,9 +66,21 @@ hsv(244, 100%, 100%, 0.6)
|
|
|
66
66
|
|
|
67
67
|
**note** The docs are for the ESM module. UMD module only exports the [default export](https://kurkle.github.io/color/modules.html#default)
|
|
68
68
|
|
|
69
|
+
### Documentation Generation
|
|
70
|
+
|
|
71
|
+
The documentation is automatically generated using TypeDoc and deployed to GitHub Pages whenever changes are pushed to the main branch.
|
|
72
|
+
|
|
73
|
+
To generate documentation locally:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npm run docs
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
This will create documentation in the `docs` directory, which you can preview locally before pushing changes.
|
|
80
|
+
|
|
69
81
|
## Benchmarks
|
|
70
82
|
|
|
71
|
-
[benchmarks](https://kurkle.github.io/color/dev/bench/)
|
|
83
|
+
[benchmarks](https://kurkle.github.io/color/dev/bench/) — see [bench/README.md](bench/README.md) for how to run them locally.
|
|
72
84
|
|
|
73
85
|
## Size visualization
|
|
74
86
|
|
package/dist/byte.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* @module utils
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Rounds decimal to nearest integer
|
|
7
|
+
* @param v - the number to round
|
|
8
|
+
*/
|
|
9
|
+
export declare function round(v: number): number;
|
|
10
|
+
export declare const lim: (v: number, l: number, h: number) => number;
|
|
11
|
+
/**
|
|
12
|
+
* convert percent to byte 0..255
|
|
13
|
+
* @param v - 0..100
|
|
14
|
+
*/
|
|
15
|
+
export declare function p2b(v: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* convert byte to percet 0..100
|
|
18
|
+
* @param v - 0..255
|
|
19
|
+
*/
|
|
20
|
+
export declare function b2p(v: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* convert normalized to byte 0..255
|
|
23
|
+
* @param v - 0..1
|
|
24
|
+
*/
|
|
25
|
+
export declare function n2b(v: number): number;
|
|
26
|
+
/**
|
|
27
|
+
* convert byte to normalized 0..1
|
|
28
|
+
* @param v - 0..255
|
|
29
|
+
*/
|
|
30
|
+
export declare function b2n(v: number): number;
|
|
31
|
+
/**
|
|
32
|
+
* convert normalized to percent 0..100
|
|
33
|
+
* @param v - 0..1
|
|
34
|
+
*/
|
|
35
|
+
export declare function n2p(v: number): number;
|