Book Image

Learning less.js

Book Image

Learning less.js

Overview of this book

Table of Contents (22 chapters)
Learning Less.js
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Defining color formats


The following is a list of the color functions that handle the color formats within Less:

Function

Purpose of the function

Example value

rgb

Creates an opaque color object from the decimal red, green, and blue (RGB) values

rgb(90, 129, 32)

rgba

Creates a transparent color object from the decimal red, green, blue, and alpha (RGBA) values

rgba(90, 129, 32, 0.5)

argb

Creates a hex representation of a color in the #AARRGGBB format (not #RRGGBBAA!)

argb(rgba(90, 23, 148, 0.5));

hsl

Creates an opaque color object from the hue, saturation, and lightness (HSL) values

hsl(90, 100%, 50%)

hsla

Creates a transparent color object from the hue, saturation, lightness, and alpha (HSLA) values

hsl(90, 100%, 50%, 0.5)

hsv

Creates an opaque color object from the hue, saturation, and value (HSV) values

hsv(90, 100%, 50%)

Tip

For more information, read the documentation on the main Less site at http://lesscss.org/functions/#color-definition. I've also created a CodePen that shows these effects in action—this is available at http://codepen.io/alibby251/pen/horqx.