Sass scale-color Function

Last Updated:

Sass scale-color Function

The scale-color() function fluidly scales one or more properties of a given color.

Example

SASS TO CSS CONVERTER
.foo{ color: scale-color(#6b717f, $red: 15%); color: scale-color(#d2e1dd, $lightness: -10%, $saturation: 10%); }

Syntax

scale-color($color, $red, $green, $blue, $saturation, $lightness, $alpha)

Parameter Value

ValueTypeExplanation
$color Required Specifies a color.
$red Optional Specifies red channel in RGB value. The arguments must be between -100% and 100% (both are inclusive).
$green Optional Specifies green channel in RGB value. The arguments must be between -100% and 100% (both are inclusive).
$blue Optional Specifies blue channel in RGB value. The arguments must be between -100% and 100% (both are inclusive).
$saturation Optional Specifies the intensity of color. The arguments must be between -100% and 100% (both are inclusive).
$lightness Optional Specifies the tone of the color. The arguments must be between -100% and 100% (both are inclusive).
$alpha Optional Specifies the degree of transparency of a color. The arguments must be between -1 and 1 (both are inclusive).

Return Value

ValueExplanation
color Returns the scaled $color

Share this Page

Meet the Author