title: Change color depending on background
body: <p>I have seen some examples but I am struggling to implement it, how can I make this arrow change color depending on the background? so either white or black.</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-js lang-js prettyprint-override"><code>if ($('#back-to-top').length) {
    var scrollTrigger = 100, // px
      backToTop = function() {
        var scrollTop = $(window).scrollTop();
        if (scrollTop &gt; scrollTrigger) {
          $('#back-to-top').addClass('show');
        } else {
          $('#back-to-top').removeClass('show');
        }
      };
    backToTop();
    $(window).on('scroll', function() {
      backToTop();
    });
    $('#back-to-top').on('click', function(e) {
      e.preventDefault();
      $('html,body').animate({
        scrollTop: 0
      }, 700);
    });
  }</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>* {
    box-sizing: border-box;
  }
  
  body {
    margin: 0;
    font-weight: 500;
    font-family: 'HelveticaNeue';
  }
  
  section {
    width: 100%;
    padding: 0 7%;
    display: table;
    margin: 0;
    max-width: none;
    background-color: #373B44;
    height: 100vh;
    &amp;:nth-of-type(2n) {
      background-color: #FE4B74;
    }
  }
  
  .intro {
    height: 90vh;
  }
  
  .content {
    display: table-cell;
    vertical-align: middle;
  }
  
  h1 {
    font-size: 3em;
    display: block;
    color: white;
    font-weight: 300;
  }
  
  p {
    font-size: 1.5em;
    font-weight: 500;
    color: #C3CAD9;
  }
  
  a {
    font-weight: 700;
    color: #373B44;
    position: relative;
    &amp;:hover {
      opacity: 0.8;
    }
    &amp;:active {
      top: 1px;
    }
  }
  
  footer {
    padding: 1% 5%;
    text-align: center;
    background-color: #373B44;
    color: white;
    a {
      color: #FE4B74;
      font-weight: 500;
      text-decoration: none;
    }
  }
  
  #back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 9999;
    width: 32px;
    height: 32px;
    text-align: center;
    line-height: 30px;
    color: #444;
    cursor: pointer;
    border: 0;
    border-radius: 2px;
    text-decoration: none;
    transition: opacity 0.2s ease-out;
    opacity: 0;
  }
  
  #back-to-top:hover {
    background: #e9ebec;
  }
  
  #back-to-top.show {
    opacity: 1;
  }
  
  #content {
    height: 2000px;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" /&gt;
  &lt;a href="#" id="back-to-top" title="Back to top"&gt;&lt;i class="fa fa-chevron-up" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;
  &lt;section class="intro"&gt;
    &lt;div class="content"&gt;
      &lt;h1&gt;You can create full screen sections without javascript.&lt;/h1&gt;
      &lt;p&gt;The height is set to 90vh, that means 90% height.&lt;/p&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section&gt;
    &lt;div class="content"&gt;
      &lt;h1&gt;Resize your browser and see how they adapt.&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section&gt;
    &lt;div class="content"&gt;
      &lt;h1&gt;It's amazing and fast.&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;section&gt;
    &lt;div class="content"&gt;
      &lt;h1&gt;See the &lt;a href="http://caniuse.com/#feat=viewport-units"&gt;browser support.&lt;/a&gt;&lt;/h1&gt;
    &lt;/div&gt;
  &lt;/section&gt;
  
  &lt;footer&gt;
    Made by &lt;a href="https://www.twitter.com/ckor"&gt;@ckor&lt;/a&gt;
  &lt;/footer&gt;</code></pre>
  </div>
  </div>
  </p>