Detect background color of a website
I don't know anything about Java or Python, but could you have it parse the html code and look for something like 'background-color: < color >'?
I am trying to detect color of different elements in a webpage(saved on machine). Currently I am trying to write a code in python. The initial approach which I followed is:

find color word in html file in different tags using regular expressions.
try to read the hex value.

But this approach is very stupid. I am new to website design, can you please help me with this.