What is the Correct way to update elements businessObject on element Color change?

What is the Correct way to update elements businessObject on element Color change i try the element.changed event listener but it’s causes Maximum call stack size exceeded
image