Language Features
- Less - Parent Selectors
- Less - Merge
- Less - Loops
- Less - CSS Guards
- Less - Mixin Guards
- Less - Import Options
- Less - Import Directives
- Less - Passing Rulesets to Mixins
- Less - Mixins as Functions
- Less - Parametric Mixins
- Less - Mixins
- Less - Extend
- Less - Variables
- Less - Importing
- Less - Comments
- Less - Scope
- Less - Namespaces and Accessors
- Less - Functions
- Less - Escaping
- Less - Operations
- Less - Nested Directives and Bubbling
- Less - Nested Rules
Functions
- Less - Color Blending Functions
- Less - Color Operation
- Less - Color Channel Functions
- Less - Color Defination Functions
- Less - Type Functions
- Less - Math Functions
- Less - List Functions
- Less - String Functions
- Less - Misc Functions
Usage
- Less - Frameworks
- Less - Third Party Compilers
- Less - Editors and Plugins
- Less - GUIs
- Less - Online Compilers
- Less - Programmatic Usage
- Less - Plugins
- Less - Browser support
- Using Less In The Browser
- Less - Command Line Usage
Less Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
LESS - Color Channel Functions
In this chapter, we will understand the importance of Color Channel Functions in LESS. LESS supports few in-built functions which set value about a channel. The channel set the value depending on the color definition. The HSL colors have hue, saturation and pghtness channel and the RGB color have red, green and blue channel. The following table psts out all the color channel functions −
Sr.No. | Function & Description | Example |
---|---|---|
1 | hue In HSL color space, the hue channel is extracted off the color object. |
background: hue(hsl(75, 90%, 30%)); It compiles in the CSS as shown below − background: 75; |
2 | saturation In HSL color space, the saturation channel is extracted off the color object. |
background: saturation(hsl(75, 90%, 30%)); It compiles in the CSS as shown below − background: 90%; |
3 | pghtness In HSL color space, the pghtness channel is extracted off the color object. |
background: pghtness(hsl(75, 90%, 30%)); It compiles in the CSS as shown below − background: 30%; |
4 | hsvhue In HSV color space, the hue channel is extracted off the color object. |
background: hsvhue(hsv(75, 90%, 30%)); It compiles in the CSS as shown below − background: 75; |
5 | hsvsaturation In HSL color space, the saturation channel is extracted off the color object. |
background: hsvsaturation(hsv(75, 90%, 30%)); It compiles in the CSS as shown below − background: 90%; |
6 | hsvvalue In HSL color space, the value channel is extracted off the color object. |
background: hsvvalue(hsv(75, 90%, 30%)); It compiles in the CSS as shown below − background: 30%; |
7 | red The red channel is extracted off the color object. |
background: red(rgb(5, 15, 25)); It compiles in the CSS as shown below − background: 5; |
8 | green The green channel is extracted off the color object. |
background: green(rgb(5, 15, 25)); It compiles in the CSS as shown below − background: 15; |
9 | blue The blue channel is extracted off the color object. |
background: blue(rgb(5, 15, 25)); It compiles in the CSS as shown below − background: 25; |
10 | alpha The alpha channel is extracted off the color object. |
background: alpha(rgba(5, 15, 25, 1.5)); It compiles in the CSS as shown below − background: 2; |
11 | luma luma value is calculated off a color object. |
background: luma(rgb(50, 250, 150)); It compiles in the CSS as shown below − background: 71.2513323%; |
12 | luminance The luma value is calculated without gamma correction. |
background: luminance(rgb(50, 250, 150)); It compiles in the CSS as shown below − background: 78.53333333%; |