可能是Compass 101,但是有人写过mixin来设置颜色的alpha值吗?理想情况下,我希望mixin采用任何形式的颜色定义并应用透明度:
@include set-alpha( red, 0.5 ); //prints rgba(255, 0, 0, 0.5);
@include set-alpha( #ff0000, 0.5 ); //prints rgba(255, 0, 0, 0.5);
@include set-alpha( rgb(255,0,0), 0.5 ); //prints rgba(255, 0, 0, 0.5);