i'm wondering how to solve that problem: I have a react app containing this components: - topbar - content (itself contains different components: topic1.js, topic2.js...) - footer
The topbar is 'fixed', you can see it permanently at the top of the page (e.g. as it is here in stackoverflow.com). The different content-components have different background colors (let us assume a dark and a bright color). Now when i'm scrolling down the page, i'd like to change the color of the topbar depending on the current color behind it. E.g. the topbar is above an content component with a dark color, it should change its color to that dark one as well .. so it will fit perfect to the current content. I added two pictures to illustrate what i mean (image_bright & image_dark). you can see the topbar containing links to different topics and its matching perfectly to the background color. what's the easiest way to do that? The content components are on a complete different hierarchy level so i can not access them directly. Maybe its also relevant to mention that i'm using material-ui. Has anyone an idea?
Thanks for your help :)