RGB Functions
HSL Functions
hsl($hue, $saturation, $lightness)
hsl(hue, saturation, lightness) //色相、饱和度、亮度
hsla($hue, $saturation, $lightness, $alpha)
hsla(hue, saturation, lightness, alpha) //色相、饱和度、亮度、透明度
hue($color) //获取颜色的色调
saturation($color) //获取颜色的饱和度
lightness($color) //获取颜色的亮度
adjust-hue($color, $degrees) // 增加或减少$color
色调。
lighten($color, $amount) //Makes a color lighter.
darken($color, $amount) //Makes a color darker.
saturate($color, $amount) //Makes a color more saturated.
desaturate($color, $amount) //Makes a color less saturated.
grayscale($color) //灰度
complement($color) //互补
invert($color) //反相
Opacity Functions
alpha($color) / opacity($color) //获取一个颜色的透明度
rgba($color, $alpha) //Add or change an alpha layer for any color value.
opacify($color, $amount) / fade-in($color,$amount) //Makes a color more opaque.
transparentize($color, $amount) / fade-out($color,$amount) //Makes a color more transparent.
Other Color Functions
adjust-color($color, [$red], [$green], [$blue], [$hue],[$saturation], [$lightness], [$alpha]) //递增或递减一个颜色任何属性
scale-color($color, [$red], [$green], [$blue], [$saturation],[$lightness], [$alpha]) //基于颜色属性上流动划分百分值
change-color($color, [$red], [$green], [$blue], [$hue],[$saturation], [$lightness], [$alpha]) //设置任何一颜色的属性
scss:
color: change-color(#8ec63f, $red: 60, $green: 255)
color: adjust-color(#8ec63f, $hue: 300, $lightness: 50%)
color: scale-color(#8ec63f, $lightness: 25%, $alpha: 30%)
编译后css:
color: #3cff3f; color: white; color: #aad46f;