You can automatically add all the colors from selected artwork or all the colors in your document to the Swatches panel. Illustrator finds the colors that are not already in the Swatches panel, converts any process colors to global colors, and adds them to the panel as new swatches.
When you automatically add colors to the Swatches panel, all colors in the document are included, except the following:
Colors inside opacity masks (when not in opacity mask editing mode)
Interpolated colors in blends
Colors in image pixels
Guide colors
Colors in objects that are inside compound shapes and are not visible
If you change a gradient fill, pattern fill, or symbol instance to a new global color, the color is added as a new swatch and the original color swatch is retained.