Note:
This feature was introduced in the Creative Cloud release for Photoshop CS6.
You can add all colors specified in an HTML, CSS, or SVG document to the Swatches panel. If a color value is repeated in a document, only one instance of the color is added not duplicates. This feature recognizes the following HTML/CSS color syntax: #112233, #123, rgb(1,2,3), rgba(1,2,3,4), hsb(1,2,3), and hsba(1,2,3,4).
For more information, see Customizing color pickers and swatches.