This problem is solved. I found out that calling a function from within a marker (and using eval() on a layer to ‘insert’ it) doesn’t work. I ended up putting all functions in a marker, and calling the main function from a layer after eval(). After that, the variables with the color information were available from any place in the comp.