Get Colors & Replace w/Palette Colors

I have participated in CQL threads about changing a color value to a new color value. I think that was simple enough. But my next question - not so much. 

How do you loop objects to get their colors and then replace with closest color from Active Palette? 

for each shape in shaperange.shapes 

Next s

I assume this requires Collections? This would be a nice thing to learn! 

  • Shelby answered here:

    For those seeking answers. This is an older post before I jumped in the "color" pool. But I realized when searching for References it was difficult  because some of these posts aren't tagged. So, ill try to properly tag my posts for those seeking references. 

    https://community.coreldraw.com/talk/coreldraw_graphics_suite_x4/f/246/p/47050/253218#253218