colorChooser

@Composable
fun MaterialDialogScope.colorChooser(colors: List<Color>, subColors: List<List<Color>> = listOf(), initialSelection: Int = 0, argbPickerState: ARGBPickerState = ARGBPickerState.None, waitForPositiveButton: Boolean = true, onColorSelected: (Color) -> Unit = {})

Parameters

colors

a list of colors for the user to choose. See ColorPalette for predefined colors

subColors

a list of subsets of colors for the user to choose from once a main color from colors has been chosen. See ColorPalette for predefined sub-colors colors

initialSelection

the index of the color which is selected initially

argbPickerState

controls the behaviour of custom argb picker

waitForPositiveButton

if true the onColorSelected callback will only be called when the positive button is pressed, otherwise it will be called when the a new color is selected

onColorSelected

a function which is called with a Color. The timing of this call is dictated by waitForPositiveButton