The following code creates a toplevel widget with a Tk canvas showing the currently selected color as its background, and a button which can be used to change the color.
Clicking on the
Change Color button gives the color-selection widget:
Change the color from blue to red:
Ok. Now the color is updated on our canvas: