Less Color Operation Functions |
Examples |
saturate:
The saturation of a color in the HSL color space increases by an absolute amount.
Framework:
- color: color object.
- amount: A percentage range from 0-100%.
- method: Optional, and is used to set the relative adjustments for current value.
Returns: color |
saturate(hsl(90, 80%, 50%), 20%)
Result:
#80ff00 // hsl(90, 100%,50%) |
desaturate:
The saturation of a color in the HSL color space decrease by an absolute amount.
Framework:
- color: color object.
- amount: A percentage range from 0-100%.
- method: Optional, and is used to set the relative adjustments for current value.
Returns: color |
desaturate(hsl(75, 90% ,30%), 20%)
Result:
#90cc33 // hsl(75, 70%, 50%) |
lighten:
The lightness of a color in the HSL color space is increased by an absolute amount.
Framework:
- color: color object.
- amount: A percentage range between 0-100%.
- method: Optional, and is used to set the relative adjustments for current value.
Returns: color |
lighten(hsl(90, 80%, 50%), 20%)
Result:
#b3f075 // hsl(90, 80%, 70%) |
darken:
The lightness of a color in the HSL color space is decreased by an absolute amount.
Framework:
- color: color object.
- amount: A percentage range from 0-100%.
- method: Optional, and is used to set the relative adjustments for current value.
Returns: color |
darken(hsl(90, 80%, 50%), 20%)
Result:
#4d8a0f // hsl(90, 80%, 30%) |
fadein:
Used to increase the opacity or decrease the color transparency and make it more blur.
Framework:
- color: color object.
- amount: A percentage range from 0-100%.
- method: Optional, and is used to set the relative adjustments for current value.
Returns: color |
fadein(hsla(90, 90%, 50%, 0.5), 10%)
Result:
rgba(128, 242, 13, 0.6) // hsla(90, 90%, 50%, 0.6) |
fadeout:
Used to decrease the opacity or increase the color transparency and make it less blur.
Framework:
- color: color object.
- amount: A percentage range from 0-100%.
- method: Optional, and is used to set the relative adjustments for current value.
Returns: color |
fadeout(hsla(90, 90%, 50%, 0.5), 10%)
Result:
rgba(128, 242, 13, 0.4) // hsla(90, 90%, 50%, 0.4) |
fade:
Used to set the absolute transparency of a color and apply colors even after having an opacity value or not.
Framework:
- color: color object.
- amount: A percentage range from 0-100%.
Returns: color |
fade(hsl(90, 90%, 50%), 10%)
Result:
rgba(128, 242, 13, 0.1) // hsla( 90, 90%, 50%, 0.1) |
spin:
The angle of a color rotate in either direction.
Framework:
- color: A color object.
- amount: number of degrees used to rotate (+ or -).
Returns: color |
spin(hsl(10, 90%, 50%), 30)
spin(hsl(10, 90%, 50%), -30)Result:#f2a60d // hsl(40, 90%, 50%)
#f20d59 // hsl(340, 90%, 50%) |
mix:
The opacity included in the calculations by mixing two colors together in variable proportion.
Framework:
- color1: Color object.
- color2: Color object.
- weight: It is optional, and by default the percentage balance point between the two colors is 50%.
Returns: color |
mix(#ff0000, #0000ff, 50%)
mix(rgba(100, 0, 0, 1.0), rgba(0, 100, 0, 0.5), 50%)Result:#8000080
rgba(75, 25, 0, 0.75) |
tint:
The color is mixed with white in variable proportion.
Framework:
- color: Color object.
- weight: It is optional, and by default the percentage balance point between the two colors is 50%.
Returns: color |
no-alpha: tint(#007fff, 50%);
with-alpha:tint(rgba(00, 0, 255, 0.5), 50%);Result:no- alpha: #80bfff;
with-alpha: rgba(191, 191, 255, 0.75); |
shade:
The color is mixed with black in variable proportion.
Framework:
- color: Color object.
- weight: It is optional, and by default the percentage balance point between the two colors is 50%.
Returns: color |
no-alpha: shade(#007fff, 50%);
with- alpha: shade(rgba(00, 0, 255,0.5), 50%);Result:no-alpha: #004080;
with-alpha: rgba(0, 0, 64, 0.75); |
greyscale:
In the HSL color space, the saturation from a color is removed.
Framework:
Returns: color |
grayscale(hsl(90, 90%, 50%))
Result:
#808080 // hsl(90, 0%, 50%) |
contrast:
Used to choose the colors, and provides the greatest contrast with another.
Framework:
- color: Color object.
- weight: It is optional, and by default the percentage balance point between the two colors is 50%.
Returns: color |
no-alpha: shade(#007fff, 50%);
with- alpha: shade(rgba(00, 0, 255,0.5), 50%);Result:no-alpha: #004080;
with-alpha: rgba(0, 0, 64, 0.75); |