Hi Tom,
I suggest you define the Input OnChange handler from the widget property section instead of registering the same by defining an additional custom JS code. The variable associated with the color type input is capturing the color change hexa value. See this sample screen: ColorInput_Task
Let us know if you are looking for something else?
Refer to the attached .oml
I hope this helps you!
Kind regards,
Benjith Sam