Change button color based on AirPicker color

I want a color selected via AirPicker to
a) immediately update the bg color of an input field on the same page
b) on save update the bg color of a button in a popup

Is this possible? Would appreciate the help