Completed class (ignores background colors except that of the specific component passed in as an argument, though), seems to work properly