colorsort-js 1.0.1 → 1.0.2
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 +8 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# colorsort
|
|
2
2
|
|
|
3
|
+
> Various color sorting method. Find out more info in the [research repository](https://github.com/darosh/colorsort-js).
|
|
4
|
+
|
|
3
5
|
## Install
|
|
4
6
|
|
|
5
7
|
```bash
|
|
@@ -14,4 +16,10 @@ import DATA from 'colorsort-js/trained.json' with { type: 'json' }
|
|
|
14
16
|
|
|
15
17
|
const colors = ['#000000', '#fff000', '#000fff']
|
|
16
18
|
const sorted = auto(colors, DATA)
|
|
19
|
+
|
|
20
|
+
console.log(sorted) // outputs sorted array ['#000fff', ...]
|
|
17
21
|
```
|
|
22
|
+
|
|
23
|
+
- The sorting method is selected automatically
|
|
24
|
+
- Some methods may require more computation time so it recommended to run this in a [web worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers)
|
|
25
|
+
- Colors must be an array of strings in this hex format `#000000`
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "colorsort-js",
|
|
3
3
|
"description": "Various color sorting methods",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Jan Forst",
|
|
7
7
|
"email": "ensonador@gmail.com"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
30
|
-
"types": "./dist/types/src/index.ts",
|
|
30
|
+
"types": "./dist/types/src/index.d.ts",
|
|
31
31
|
"import": "./dist/colorsort.js",
|
|
32
32
|
"require": "./dist/colorsort.umd.js"
|
|
33
33
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"private": false,
|
|
47
47
|
"repository": "https://github.com/darosh/colorsort-js.git",
|
|
48
48
|
"type": "module",
|
|
49
|
-
"types": "./dist/types/src/index.ts",
|
|
49
|
+
"types": "./dist/types/src/index.d.ts",
|
|
50
50
|
"scripts": {
|
|
51
51
|
"bench": "deno --allow-write scripts/bench.js",
|
|
52
52
|
"build": "tsc && vite build",
|