See this GitHub repository for more information and working example:

 

https://github.com/Inflectra/rapise-powerpack/tree/master/GetDOMElementColor