I’ve implemented a simple color picker that gets assets colors in my Frame Maker plugin.
If you need to look at the code:
https://github.com/paolobiagini/xd-frame-maker
Hope it helps.
Keep in mind that I’m just a designer so the javascript logic could be not very professional.