getBrightnessAdjustedDominantColor

suspend fun Drawable.getBrightnessAdjustedDominantColor(@ColorInt defaultColor: Int, dispatcher: CoroutineDispatcher = Dispatchers.Default): Int

Returns the drawable's dominant color with a brightness adjustment. If no dominant color is available it falls back to defaultColor. The brightness value of the dominant color is adjusted to an average value in between the original one and the defaultColor brightness value. Therefore, the returned dominant color can be brighter or darker than the original dominant color.

Parameters

defaultColor

default color used as fallback color or for adjusting the dominant color brightness value.

dispatcher

The dispatcher to extract the dominant color. The default is Dispatchers.Default and it is recommended to keep this as extracting the dominant color can be a heavy process.