I have created this function to pick color from image.
fun getMainColor(img: Bitmap): Int {
val newImg = Bitmap.createScaledBitmap(img, 1, 1, true)
val color = newImg.getPixel(0, 0)
newImg.recycle()
return color
}
But it usually chooses a Light Shade color that makes the UI so Ugly, I want it to Choose a dark shade from the image. How Could I do that!
CodePudding user response:
Palette API is good solution for find the colors from the Image with multiple choices.