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

Channeling colors using Less


The following is a list of the functions that allow us to channel colors when using Less:

Function

Purpose of the function

Example value

hue

Extracts the hue channel of a color object in the HSL color space

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

saturation

Extracts the saturation channel of a color object in the HSL color space

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

lightness

Extracts the lightness channel of a color object in the HSL color space

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

hsvhue

Extracts the hue channel of a color object in the HSV color space

hsvhue(hsv(90, 100%, 50%))

hsvsaturation

Extracts the saturation channel of a color object in the HSV color space

hsvsaturation(hsv(90, 100%, 50%))

hsvvalue

Extracts the value channel of a color object in the HSV color space

hsvvalue(hsv(90, 100%, 50%))

red

Extracts the red channel of a color object

red(rgb(10, 20, 30))

green

Extracts the green channel of a color object

green(rgb(10, 20, 30))

blue

Extracts the blue channel of a color object

blue(rgb(10, 20, 30))

alpha

Extracts the alpha channel of a color object

alpha(rgba(10, 20, 30, 0.5))

luma

Calculates the luma (perceptual brightness) of a color object

luma(rgb(100, 200, 30))

luminance

Calculates the value of the luma without gamma correction

luminance(rgb(100, 200, 30))

Tip

For more information, read the documentation on the main Less site at http://lesscss.org/functions/#color-channel.