Automatic text color from background in CSS

Creating a CSS rule that automatically changes the text color based on the background color of the element.