Skip to content

Instantly share code, notes, and snippets.

@tbisaacs
Created November 28, 2012 18:54
Show Gist options
  • Save tbisaacs/4163243 to your computer and use it in GitHub Desktop.
Save tbisaacs/4163243 to your computer and use it in GitHub Desktop.
color generator
$services: 50
$colors: $blue $green $red $grayLight $purple
@for $i from 1 through 10
@each $color in $colors
.service_#{$services}
$computed: adjust-hue($color, $i*4)
@if $i == 10
// background: rgba($color, .8)
+contrasted($color)
border-color: shade($color, 25%)
+box-shadow(tint($color, 40%) 0 0 0 1px inset, rgba(#000, .4) 0 0 2px)
a
// color: contrast-color($color, black, white, 55%)
+text_color($color)
@else
// background: rgba($computed, .8)
+contrasted($computed)
border-color: shade($computed, 25%)
+box-shadow(tint($computed, 40%) 0 0 0 1px inset)
a
// color: contrast-color($computed, black, white, 70%)
+text_color($computed)
$services: $services - 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment