1.0.3 • Published 6 months ago

imagepathcolorpicker v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

This package, is will take the image file path, and check the pixels in the image. It then returns the main color present, ignoring transparent pixels. This should allow for responsive filling of colors in related elements based on the image being used.

Example Implementation:

import { getColor } from 'imagecolorpicker'

const HexColor, setHexColor = useState('');

useEffect(() => {
  // Call the function with the image path and handle the Promise
  getStackColour(imageUrl)
    .then((result) => {
      const hexColor = result.hex;
      setHexColor(hexColor);
    })
    .catch((error) => {
      console.error('Error:', error);
    });
}, []);
1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago