-
Book Overview & Buying
-
Table Of Contents
Learning less.js
By :
The functions available within Less can be used to provide some interesting colors. It is worth taking the time to familiarize yourself with the options available, particularly as it is possible to produce the same color using different methods!
The functions can be split into four groups—they cover color definition, channels, operations, and blending. Let's take a look at each group of functions in turn, starting with defining color formats.
Before we can alter colors, we naturally need to define them. We could simply provide a HEX code, but this isn't always sufficient; Less allows us to do more. Less provides a number of methods to obtain colors using different formats, and these are the three that you will likely use the most:
|
Function |
Creates an opaque color from |
Example value |
|---|---|---|
|
|
Decimal red, green, and blue (RGB) values |
|
|
|
Hue, saturation, and lightness (HSL) values |
|
Change the font size
Change margin width
Change background colour