sass 方法

官方地址http://sass-lang.com/documentation/Sass/Script/Functions.html
方法的使用示例:

$color: hsl(120deg, 100%, 50%)

接下来是各个方法的描述:
RGB function RGB方法

rgb($red, $green, $blue) //红绿蓝三原色 rgb颜色方法
rgba($red, $green, $blue, $alpha) rgba颜色方法
red($color) ://获取一个颜色中红色的值(rgb类型的值)

green($color) : //获取一个颜色中绿色的值(rgb类型的值)

blue($color) ://获取一个颜色中蓝色的值(rgb类型的值)
mix($color1, $color2, [$weight]) : 获取两种颜色的混合值,$weight:混合比例0-100,值越大第一种颜色的比例越多,默认值50

HSL Functions HSL颜色

hsl($hue, $saturation, $lightness) :色相(0-359)、饱和度、亮度(0-1)
hsla($hue, $saturation, $lightness, $alpha) //同上,多了个透明度
hue($color) ://获取hsl中的 色相
saturation($color) ://获取hsl中的 饱和度
lightness($color) : //获取hsl中的 亮度
adjust-hue($color, $degrees) ://调整hsl色相0为不调整,可以为 正无穷或负无穷
lighten($color, $amount) : //调整亮度0-1

darken($color, $amount) : //调整亮度0-1

saturate($color, $amount) : //调整颜色的 饱和度

desaturate($color, $amount) : //调整颜色的 饱和度

grayscale($color) : Converts a color to grayscale.//提取灰度

complement($color) : Returns the complement of a color.//对颜色进行一定的补充

invert($color, [$weight]) : Returns the inverse of a color.//颜色翻转

Opacity Functions 透明度

alpha($color) / opacity($color) : //获取透明度

rgba($color, $alpha) : //调整透明度

opacify($color, $amount) / fade-in($color, $amount) : //使颜色变得不透明

transparentize($color, $amount) / fade-out($color, $amount) : //使颜色变得更透明

Other Color Functions

adjust-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha]) : Increases or decreases one or more components of a color.//调整颜色值

scale-color($color, [$red], [$green], [$blue], [$saturation], [$lightness], [$alpha]) : Fluidly scales one or more properties of a color.//批量调整颜色属性

change-color($color, [$red], [$green], [$blue], [$hue], [$saturation], [$lightness], [$alpha]) : Changes one or more properties of a color.//变更颜色属性

ie-hex-str($color) : Converts a color into the format understood by IE filters.//转换成ie颜色
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值