dear-image.detect-color-scheme
v1.0.2
Published
Detects the image color scheme.
Downloads
200
Readme
DearImage.detectColorScheme
DearImage.detectColorScheme(image)
Detects the image color scheme.
| argument | description |
| ---: | :--- |
| image
| Everything the function .loadFrom
supports. |
Returns a promise that resolves to the detected color scheme.
dependencies
setup
npm
npm i dear-image.detect-color-scheme
ES module
import 'dear-image.detect-color-scheme';
import DearImage from 'dear-image';
Node
require('dear-image.detect-color-scheme');
let DearImage = require('dear-image');
browser
<script src="https://unpkg.com/dear-image"></script>
<script src="https://unpkg.com/just-my-luck"></script>
<script src="https://unpkg.com/@seregpie/k-means"></script>
<script src="https://unpkg.com/@seregpie/k-means-plus-plus"></script>
<script src="https://unpkg.com/dear-image.detect-color-scheme"></script>
usage
let colorScheme = await DearImage.detectColorScheme(image);
// => [['#acacac', 9], ['#24ff00', 1]]