Hi!
If I have a header with a transparent background, can I make it so that the content/text within the header changes color based on the background? For example, I want it so that if the header is on a dark background, the text is white, and if it's on a light background, the text is black. Is this possible through Velo or regular Wix features?
Thank you so much!
~Henry
let myElementsBGcolor = $w('#YourElementsIDhere').style.backgroundColor
https://www.wix.com/velo/reference/$w/style/backgroundcolor
Get first the color of your element.
Then do some if-else-queries to chnage corresponding elements color.
if () { } else { }
if (myElementsBGcolor==="red") { if yes, do something here } else { if not, do something here }
-Perhaps you also will have to convert the color first to the right format.
I just tried this and it unfortunatly didn't work for me (Editor X). Did it work for you @Henry? @Velo-Ninja could you please help me out? When I check in the consol log the background color for transparent objects is undefined.
What do you mean by "Perhaps you also will have to convert the color first to the right format."?
Thank you so much!