Skip to content

Commit

Permalink
luma correction for Less 1.7
Browse files Browse the repository at this point in the history
Less 1.7 use a different way to calculate the luma() of a color, see:  less/less.js#1890
luminance() gives the "old" value for backward compatibility.
  • Loading branch information
bassjobsen committed Apr 16, 2014
1 parent 7f706ba commit 52a0e4b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scheme.less
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
///////////////////////////

@sat:saturation(@seed-color);
@luma:luma(@seed-color);
@luma:luminance(@seed-color);
@lit:lightness(@seed-color);
@tone:desaturate(@seed-color,100%);

Expand Down Expand Up @@ -113,12 +113,12 @@

// contrasts text against a given background color

.contrast (@color) when (luma(@color) >= @luma-upper-break) {
.contrast (@color) when (luminance(@color) >= @luma-upper-break) {
//darker text for lighter backgrounds
color:average(darken(@color,30%),#222);
}

.contrast (@color) when (luma(@color) < @luma-upper-break) {
.contrast (@color) when (luminance(@color) < @luma-upper-break) {
//white text for everything else
color:#ffffff;
}
Expand Down

0 comments on commit 52a0e4b

Please sign in to comment.