Skip to content

Instantly share code, notes, and snippets.

@boennemann
Created February 7, 2012 12:18
Show Gist options
  • Save boennemann/1759427 to your computer and use it in GitHub Desktop.
Save boennemann/1759427 to your computer and use it in GitHub Desktop.
Environment aware coloring with lesscss
/* http://lesscss.org/ */
@color: #607794; // contrast -> white
@color: #6f86a4; // contrast -> black
@lightness: lightness(@color);
@contrast-color: color(~`(function(){if(parseInt('@{lightness}')>50){return '#000'}else{return '#fff'}})()`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment