To implement a basic color picker, add the ColorPickerView to your XML layout and set a ColorEnvelopeListener in your Activity or Fragment to handle color changes.
The listener provides a ColorEnvelope which contains the selected color as an integer, a hex code, or an ARGB array.
<com.skydoves.colorpickerview.ColorPickerView
android:id="@+id/colorPickerView"
android:layout_width="300dp"
android:layout_height="300dp" />
val colorPickerView = findViewById<ColorPickerView>(R.id.colorPickerView)
colorPickerView.setColorListener(ColorEnvelopeListener {
envelope, fromUser ->
// Get color values
val color = envelope.color
val hexCode = envelope.hexCode
val argb = envelope.argb
})