Run a function on render + watchers

For my Widget, Contrast Checker | Figma Community

  • I’d love to run my widget on render. (But it sets state)
  • I’d also love to watch changes for the parent frame (the colour specifically, but any changes would also work.)
  • I’d also like to run if the widget is dropped into a new frame

From what I can see none of these are possible yet? .on exists but I do not have access to the context?

Cheers for all help and advice.