Doodle App - Multiple colors options? color picker

Hi, I am in need of help, so I have made a draw app in which there is a color picker (image on canvas) which displays set pixel color on the screen called edits. I want to make the color picker canvas's pixel as a pen color when the button is clicked or to automatically set it when the cursor (ball) on the canvas is idle for a few seconds. The button name is called "Penning" Here is what i have done:



Here is how the color picker looks like

Please tell me what to do everyone.