Is there a way to determine the background color used in the html, from inside an angular component? I am writing an angular component that's inside one of the many feature modules used where I need to know the background color used by the page, and I would like to determine dynamically the background color utilized. The webpage has multiple tabs, and this component can appear in any tab
CodePudding user response:
try this:
getComputedStyle(document?.querySelector?.("body") as Element).backgroundColor