colorsort-js 2.0.0 → 3.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.
- package/README.md +7 -1
- package/dist/colorsort.js +894 -865
- package/dist/colorsort.js.map +1 -1
- package/dist/colorsort.umd.cjs +3 -3
- package/dist/colorsort.umd.cjs.map +1 -1
- package/dist/trained.json +1439 -1439
- package/dist/types/src/auto-sort.d.ts +6 -0
- package/dist/types/src/auto.d.ts +1 -1
- package/dist/types/src/index.d.ts +2 -1
- package/dist/types/src/round.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,11 +13,17 @@ npm i colorsort-js
|
|
|
13
13
|
```javascript
|
|
14
14
|
import { auto } from 'colorsort-js'
|
|
15
15
|
import DATA from 'colorsort-js/trained.json' with { type: 'json' }
|
|
16
|
+
import { multiAuto } from './auto-sort'
|
|
16
17
|
|
|
17
18
|
const colors = ['#000000', '#fff000', '#000fff']
|
|
18
|
-
const sorted = auto(colors, DATA)
|
|
19
19
|
|
|
20
|
+
// SINGLE SORT
|
|
21
|
+
const sorted = auto(colors, DATA)
|
|
20
22
|
console.log(sorted) // outputs sorted array ['#000fff', ...]
|
|
23
|
+
|
|
24
|
+
// MULTIPLE SORT - runs multiple methods, first item should be the best
|
|
25
|
+
const multipleSorted = multiAuto(colors, DATA)
|
|
26
|
+
console.log(multipleSorted[0].sorted) // outputs sorted array ['#000fff', ...]
|
|
21
27
|
```
|
|
22
28
|
|
|
23
29
|
- The sorting method is selected automatically
|