$colors: (
  red: #b71c1c,
  pink: #880e4f,
  purple: #4a148c,
  deep-purple: #311b92,
  indigo: #1a237e,
  blue: #0d47a1,
  deep-blue: #1e293b,
  light-blue: #01579b,
  cyan: #006064,
  teal: #004d40,
  green: #1b5e20,
  light-green: #33691e,
  line: #827717,
  yellow: #f57f17,
  amber: #ff6f00,
  orange: #e65100,
  deep-orange: #bf360c,
  brown: #3e2723,
  grey: #212121,
  light-grey: #999999,
  blue-grey: #263238,
  black: #000,
);
$supe-light: 44%;

:root {
  @each $n, $hex in $colors {
    --#{"" +$n}-900: #{$hex};
    @for $i from 1 through 8 {
      $percent: $i * 4%;
      $num: 9 - $i;
      --#{"" +$n}-#{$num}00: #{lighten($hex, $percent)};
    }
    --#{"" +$n}-50: #{lighten($hex, $supe-light)};
  }
}

//@each $name, $hex in $colors {
//  .bg-#{$name}-900 {
//    background: #{$hex};
//  }
//  .text-#{$name}-900 {
//    color: #{$hex};
//  }
//  @for $i from 1 through 8 {
//    $percent: $i * 4%;
//    $num: 9 - $i;
//    .bg-#{$name}-#{$num}00 {
//      background: #{lighten($hex, $percent)};
//    }
//    .text-#{$name}-#{$num}00 {
//      color: #{lighten($hex, $percent)};
//    }
//  }
//  .bg-#{$name}-50 {
//    background: #{lighten($hex, $supe-light)};
//  }
//  .text-#{$name}-50 {
//    color: #{lighten($hex, $supe-light)};
//  }
//}
