$colors:
  primary0 #4C4c4E,
  primary1 #177F62,
  primary2 #BDE3DC,
  secondary0 #F05555,
  secondary1 #FCDED6,
  highlight0 #bd3f42,
  highlight1 rgba(0, 0, 0, .2),
  highlight2 rgba(0, 0, 0, .4),
  highlight3 rgba(0, 0, 0, .6),
  highlight4 rgba(0, 0, 0, .8),
  highlight5 rgba(0, 0, 0, .9),
  highlight6 rgba(255, 255, 255, .2),
  highlight7 rgba(255, 255, 255, .4),
  highlight8 rgba(255, 255, 255, .5),
  highlight9 rgba(255, 255, 255, .8),
  highlight10 rgba(255, 255, 255, .9),

  facebook #3b5998,
  twitter #4099ff,
  google-plus #dd4B39,
  youtube #bb0000,
  linkedin #007bb6,
  instagram #517fa4,
  pinterest #cb2027,
  vine #00bf8f,
  snapchat #fffc00,
  quora #a82400,
  flickr #ff0084,
  tumblr #32506d,
  vk #34558e,
  vimeo #aad450,
  foursquare #0072b1,

  notify #4C4C4E,
  error #F05555,
  success #177F62,
  warning #FCDED6,

  gray0 #333,
  white0 #fff,
  black0 #000,
  githubGray #F7F7F7;

// Background colors class names.
@each $color in $colors {
  .background-#{nth($color, 1)} {
    background-color : nth($color, 2);
  }

  .background-#{nth($color, 1)}-important {
    background-color : nth($color, 2) !important;
  }

}

// Text colors.
@each $color in $colors {
  .text-#{nth($color, 1)} {
    color : nth($color, 2);
  }


  a.link-#{nth($color, 1)} {
    color : nth($color, 2);
  }

  .link-#{nth($color, 1)} a {
    color : nth($color, 2)
  }

  a.link-hover-#{nth($color, 1)}:hover {
    color : nth($color, 2);
  }

  .link-hover-#{nth($color, 1)} a:hover {
    color : nth($color, 2);
  }

  .text-#{nth($color, 1)}-important {
    color : nth($color, 2) !important;
  }


  a.link-#{nth($color, 1)}-important {
    color : nth($color, 2) !important;
  }

  .link-#{nth($color, 1)}-important a {
    color : nth($color, 2) !important;
  }

  a.link-hover-#{nth($color, 1)}-important:hover {
    color : nth($color, 2) !important;
  }

  .link-hover-#{nth($color, 1)}-important a:hover {
    color : nth($color, 2) !important;
  }

}

// Fade
@each $color in $colors {
  .fade-#{nth($color, 1)} {
    &:after {
      @include background-image(linear-gradient(rgba(255, 255, 255, 0), nth($color, 2)));

      content: "";
      display: block;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;

    }
  }
}


// Border colors class names.
@each $color in $colors {
  .border-#{nth($color, 1)} {
    border: 1px solid nth($color, 2);
  }
}

@function getValueByKey($map, $key) {
  @each $index in $map {
    @if nth($index, 1) == $key {
      @return nth($index, 2);
    }
  }
}

// Get a color by it name on the colors list.
@function getColor($colorName) {
  @return getValueByKey($colors, $colorName);
}
