How to get color of element?

Hello, I am trying to get the color of an element. I found out that there is a function for it in BpmnRenderUtil.js:

export function getFillColor(element, defaultColor) {
  return getDi(element).get('bioc:fill') || defaultColor || 'white';
}

But I am wondering how I can access this function with my modeler instance. modeler.get("BpmnRender").getFillColor does not work for me.

Depending on your project setup you can use

import {
  getFillColor
} from 'bpmn-js/lib/draw/BpmnRenderUtil';

Otherwise, you can simply copy the functionality, since those are really just helper functions.