You can combine objects based on their color.
Objects compounded by color are converted to outlines.
Original objects
Normal compound
Compound by color
See Also
Compounding Objects
Releasing Compounded Objects