Palette
class Palette
A helper class to extract prominent colors from an image.
A number of colors with different profiles are extracted from the image:
Vibrant
Vibrant Dark
Vibrant Light
Muted
Muted Dark
Muted Light
These can be retrieved from the appropriate getter method.
Instances are created with a Builder which supports several options to tweak the generated Palette. See that class' documentation for more information.
Generation should always be completed on a background thread, ideally the one in which you load your image on. Builder supports both synchronous and asynchronous generation:
Palette p = Palette.from(pixels, width, height).generate();Content copied to clipboard