The Less colors are defined in the same way as in CSS; color
is a color keyword, an RGB hex value, or the equivalent triplet of the numerical RGB values.
For this recipe, you can use your favorite text editor and the command-line lessc
compiler, as described in the Installing the lessc compiler with npm recipe in Chapter 1, Getting to Grips with the Basics of Less.
Write the following code into a Less file and compile this file with the command-line
lessc
compiler:colors { color1: color("red"); color2: color("#ff0000"); color3: color("#f00"); }
The preceding Less code will compile into the following CSS code:
colors { color1: #ff0000; color2: #ff0000; color3: #ff0000; }