I have problem when using `Palette` API in Compose...
# compose
m
I have problem when using
Palette
API in Compose. it won’t generate palette for given image, same code works in old View System code.
Copy code
Palette.from(bitmap)
    .setRegion(0, 0, bitmap.width, 50) // arbitrary 50 height, doesn't matter the number it never works
    .maximumColorCount(3)
    .generate { palette -> ...}
am trying to capture top region of the given image and extract dominant colour in that region
solved it, running same code inside a coroutine and it works