useImageColor is a React hook to grab a color palette from images. Render a skeleton color while your original image still loading.
# NPM
$ npm i use-image-color --save
import useImageColor from 'use-image-color'export function Card() {
const { colors } = useImageColor(url, {
cors: true,
colors: 5,
format: 'hex', // or 'rgb'
windowSize: 50
})
return ();
}
import { Image } from 'use-image-color'export function Card() {
return (
<Image src={url} thumbnail={thumbnail} wrapperStyle={styles} wrapperClass={classes} />
);
}
Author: jeffersonlicet
Live Demo: View The Demo
Download Link: Download The Source Code
Official Website: https://github.com/jeffersonlicet/use-image-color
License: MIT