rememberThemeColor
Create and remember the most suitable color for a UI theme in the image loader loads for input.
The image is loaded and quantized off the main thread, so the first composition sees fallback and later ones see the scored color. Results are cached by input, which means going back to an image you already used costs nothing.
kmpalette ships loaders for byte arrays, painters and drawable resources, and its extension artifacts add base64 strings, network URLs and files.
Return
The most suitable color for a UI theme, or fallback until there is one.
Parameters
The ImageBitmapLoader that turns input into an image.
The input to load, and the cache key of its result.
color to be returned if no other options available.
whether to filter out undesirable combinations.
The maximum number of palettes to cache. If 0, no caching will be done.
The CoroutineContext to generate the palette on.
A lambda applied to the Palette.Builder to customize the generation.
Type Parameters
The type of the input to load with loader.