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 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