Skip to content

bad4iz/color-picture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

get average color by image

demo
npm package


install

yarn add color-picture

// or

npm i --save color-picture

use

import { getAverageRGBA } from "color-picture";


const img = document.querySelector('img');
const backgr = getAverageRGBA(img);
document.body.style.backgroundColor = backgr;

demo
source demo