When analyzing a static webpage where the only source of colors is in either the CSS files or HTML file itself, how can we extract foreground-background color pairs from the page? For instance, on the Google home page, some potential color pairs could be (assuming GOOGLE is displayed as text):
(Foreground, Background) : (blue, white), (Red, white), (Yellow, white), (Green, white), (blue, white), (Green, white).
One approach to consider is examining the DOM tree structure of a webpage, starting from the root node HTML. The (Foreground, Background) assigned to a parent tag in HTML or in CSS would serve as the default color for all its children. However, if a child belongs to a specific class in the CSS, then the color property defined in that class would override the parent's colors. Any suggestions or alternative methods/tools for obtaining these results are welcome.