The Amazing Color Changing Menu
Scoll Down to see it in action
The only dependancy is ScrollMagic, to switch classes on the Menu icon when we enter a new section.
Check out their animate with CSS example for more details.
Menu color is changed by grabbing each section’s background-color property.
window.getComputedStyle(section, null).getPropertyValue('background-color');
The returned RGB value is then converted to YIQ.
A value of 128 or above in YIQ means text should be black for legibility, otherwise our text is white.
By Lancekey