Show TOC

Typical LESS FunctionsLocate this document in the navigation structure

The following is a list of typical LESS functions for colors:

Table 1:
LESS Function Description
saturate(@color, 10%); Returns a color 10% points more saturated
desaturate(@color, 10%); Returns a color 10% points less saturated
lighten(@color, 10%); Returns a color 10% points lighter
darken(@color, 10%); Returns a color 10% points darker
fade(@color, 50%); Returns @color with 50% transparency
spin(@color, 10); Returns a color with a 10 degree larger in hue
mix(@color1, @color2, [@weight: 50%]); Returns a mix of @color1 and @color2
greyscale(@color); Returns a grey, 100% desaturated color
contrast(@color1, [@darkcolor: black], [@lightcolor: white], [@threshold: 43%]); Returns @darkcolor if @color1 is > 43% luma (perceptual brightness), otherwise returns @lightcolor