package Ġcolor picker layout . inl ac ou . bv apps . com . color picker layout Ċ Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . util . Log Ċ import Ġandroid . widget . Toast Ċ import Ġcolor picker layout . inl ac ou . bv apps . com . color pick layout . Color Listener Ċ import Ġcolor picker layout . inl ac ou . bv apps . com . color pick layout . Color Pick Layout Ċ import Ġcolor picker layout . inl ac ou . bv apps . com . color pick layout . Color Wrapper Ċ import Ġcolor picker layout . inl ac ou . bv apps . com . color pick layout . Utils Ċ import Ġkotlinx . android . synt hetic . main . activity _ example .* Ċ Ċ class ĠExample Color Picker View Ġ: ĠAppCompatActivity () Ġ{ ĊĊ ĉ override Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ Ċĉ ĉ super . onCreate ( savedInstanceState ) Ċĉ ĉ set ContentView ( R . layout . activity _ example ) ĊĊĉ ĉ color Picker Layout . set Selector ( color Listener ) Ċĉ ĉ color Picker Layout . single ClickListener Ġ= Ġobject : ĠColor Pick Layout . Single ClickListener { Ċĉĉ ĉ override Ġfun Ġon Single Click () Ġ{ Ċĉĉĉ ĉ Toast . makeText ( this @ Example Color Picker View , Ġ" Single Ġclick ", ĠToast . LENGTH _ SHORT ). show () Ċĉĉ ĉ } Ċĉ ĉ } ĊĊĉ ĉ Log . d (" color ", ĠUtils . getColor Html ( Color . BLACK )) Ċĉ ĉ Log . d (" color ", Ġ"" + Color . parse Color ("# DDDD DD ")) Ċ ĉ } ĊĊ ĉ private Ġval Ġcolor Listener Ġ= Ġobject : ĠColor Listener Ġ{ Ċĉ ĉ override Ġfun Ġon Color Selected ( envelope : ĠColor Wrapper ) Ġ{ Ċĉĉ ĉ color Display . set BackgroundColor ( envelope . color ) Ċĉ ĉ } Ċ ĉ } Ċ Ċ }