less/less.js — pull request #1386 by lisandropuzzolo (2013-06-26 14:06:01+00:00)
Title: Added functions that helps in finding more contrasting colors

I added 3 color functions:

invertluma(color)
This function inverts the luma component of a color. If its luma was 27%, it will be 73%

contrastmore( color1, color2, minLumaDIfference = 30% )
This function is very usefull when you need color2 to be legible against color1 (based on luma).
If color2 and color1 have a luma less than minLumaDIfference (30% default), color2 will be moved far away in luminance from color1.
If the resulting color2 luma is more than 1 or less than 0, its pivoted around color1, so the resulting color will be "near" than color1.

autocontrast( color1, color2, minLumaDIfference = 30% )
This function is similar than contrastmore and is very usefull when you need color2 to be legible against color1 (based on luma).
If color2 and color1 have a luma less than minLumaDIfference (30% default), color2 will be moved far away in luminance from color1.
If the resulting color2 luma is more than 1 or less than 0, its luma gets INVERTED, so the resulting color2 luma will be far away from color1 luma.
It works better than contrastmore for buttons colors (background color and text color)