title: CSS - Change text color depending on background
body: <p>I have a simple layout consisting of three full height divs and a fixed header bar.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body,html {
    padding:0;
    margin:0;
  }
  
  .header {
    position:fixed;
    width:100%;
    height:50px;
    color:white;
    margin:20px;
  }
  
  .section1 {
    background:black;
    height:100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color:white;
  }
  
  .section2 {
    background:white;
    height:100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .section3 {
    background:black;
    height:100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color:white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="header"&gt;
    Header Content
  &lt;/div&gt;
  &lt;div class="wrapper"&gt;
    &lt;div class="section1"&gt;
      Section One Content
    &lt;/div&gt;
    &lt;div class="section2"&gt;
      Section Two Content
    &lt;/div&gt;
    &lt;div class="section3"&gt;
      Section Three Content
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I am trying to make the header bar text colour change to black when it rolls over the section with the white background.</p>
  
  <p>I have seen a couple of jQuery plugins which should work to achieve this but I am trying to avoid any unnecessary scripts.</p>
  
  <p>Would the CSS <code>mix-blend-mode</code> function allow me to achieve this? Does anybody have an example they can point me to of something similar being achieved?</p>