 
   matchProximity = ->
     colour = document.getElementById("proximityMatch").value
+    sections = $(".styleguide__colours").removeClass("has-match").removeAttr("style")
+
     colourBlocks = $(".styleguide-block__item--colour")
     colourBlocks.each ->
       proximity = colourProximity(colour, @.innerHTML)
-      
+
       # Remove previous classes
       @.parentNode.removeAttribute "style"
       @.parentNode.className = @.parentNode.className.replace(" is-approximate", "").replace(" isnt-approximate", "")


  resetProximity = ->
    document.getElementById("proximityMatch").value = ""
    $(".js-card-container .card").each ->
      @.removeAttribute "style"
      @.classList.remove('isnt-approximate')


  hexToRGB = (colour) ->
    colour = colour.replace(/^#/, "").match(/[0-9a-z]{2}/gi)
    [parseInt(colour[0], 16), parseInt(colour[1], 16), parseInt(colour[2], 16)]
