react-native-material-palette
react-native-material-palette copied to clipboard
Support custom colour profiles
Add option to create a custom colour profile and use it with addTarget
method (https://developer.android.com/training/material/palette-colors.html#extract-color-profiles and https://developer.android.com/reference/android/support/v7/graphics/Palette.Builder.html#addTarget(android.support.v7.graphics.Target)).
The main difficulty is to find a nice way to create Target
in JS and pass it to the native side (https://developer.android.com/reference/android/support/v7/graphics/Target.html).
What do you think about,
type Target = {
lightnessWeight: number,
maximumLightness: number,
maximumSaturation: number,
minimumLightness: number,
minimumSaturation: number,
populationWeight: number,
saturationWeight: number,
targetLightness: number,
targetSaturation: number,
isExclusive: boolean,
}
type Options = {
region?: { top: number, left: number, bottom: number, right: number },
maximumColorCount?: number,
type?: ColorProfile | Array<ColorProfile> | Target | Array<Target>,
}
Looks fine, are all of those properties required?
Likely not and might have default values. but hard to say from reading the API docs.