Operating on colors

The following is a list of the operation functions that can be applied to the Less code:

Function

Purpose of the function

Example value

saturate

Increases the saturation of a color in the HSL color space by an absolute amount.

saturate(hsl(0, 59.4%, 40.6%), 20%);

desaturate

Decreases the saturation of a color in the HSL color space by an absolute amount.

desaturate(hsl(0, 59.4%, 40.6%), 20%);

lighten

Increases the lightness of a color in the HSL color space by an absolute amount.

lighten(hsl(0, 59.4%, 40.6%), 20%);

darken

Decreases the lightness of a color in the HSL color space by an absolute amount.

darken(hsl(0, 59.4%, 40.6%), 20%);

fadein

Decreases the transparency (or increases the opacity) ...

Get Learning Less.js now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.