Video RGBW values output for custom ambilight?

Hi!

I have a Xiaomi Yeelight that accepts rgbw-values submitted through python. I’m curious if there is a plugin for Kodi that can read screen rgbw value at a set polling rate then output the rgbw values to either a file or as attributes to a script being called?

Anyone tried something similar?