Skip to content

SeregPie/DearImage.detectBackgroundColor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DearImage.detectColorScheme

DearImage.detectColorScheme(image)

Detects the image background color.

argument description
image Everything the function .loadFrom supports.

Returns a promise that resolves to the detected background color.

dependencies

setup

npm

npm i dear-image.detect-background-color

ES module

import 'dear-image.detect-background-color';
import DearImage from 'dear-image';

Node

require('dear-image.detect-background-color');
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>
<script src="https://unpkg.com/dear-image.detect-background-color"></script>

usage

let backgroundColor = await DearImage.detectBackgroundColor(image);
// => '#1b1b1b'

About

Detects the image background color.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published