Get dominant color from image url
npm install react-native-image-dominant-colorGet dominant color from image url
``sh`
npm install react-native-image-dominant-color --save
or
`sh`
yarn add react-native-image-colors
Install Pods
`sh`
cd ios && pod install
`js
import { getColor } from 'react-native-image-dominant-color';
// ...
async function getDominantColor(imageUrl: string): Promise
const result = await getColor('https://all-image.com/1.jpg'); // your image url
console.log(result.dominantColor); //Ex rgba(64.0, 72.0, 240.0, 1.0)
}
``
See the contributing guide to learn how to contribute to the repository and the development workflow.
MIT
---
Made with create-react-native-library