You can understand why I\'m trying to find the dominant color in an image if you use Windows 7. When your mouse over a program in the taskbar, the background of that partic
To find the Dominant / Vibrant / Muted color from an image, use Palette:
import:
implementation 'androidx.palette:palette:1.0.0'
usage:
val bitmap = BitmapFactory.decodeResource(resources, R.drawable.image)
Palette.Builder(bitmap).generate { it?.let { palette ->
val dominantColor = palette.getDominantColor(ContextCompat.getColor(context!!, R.color.defaultColor))
// TODO: use dominant color
} }