You might be able to do what you want with a
stored template. If I am understanding correctly (not at all sure

) then the stored template would compute the color based on the column content. The color rule would 'call' the template and return the color. The composite column template would call the template and do whatever you want with the returned value.