我需要将百分比值 (51%) 转换为数字 (0.51)
做这个的最好方式是什么?
我的少片段
// Gradients
#gradient {
.vertical-gloss(@startColor: #555, @endColor: #333, @firstColorStop:50%, @secondColorStart:51%) {
background-image: linear-gradient(bottom, @startColor @firstColorStop, @endColor @secondColorStart);
background-image: -o-linear-gradient(bottom, @startColor @firstColorStop, @endColor @secondColorStart);
background-image: -moz-linear-gradient(bottom, @startColor @firstColorStop, @endColor @secondColorStart);
background-image: -webkit-linear-gradient(bottom, @startColor @firstColorStop, @endColor @secondColorStart);
background-image: -ms-linear-gradient(bottom, @startColor @firstColorStop, @endColor @secondColorStart);
background-image: -webkit-gradient(linear, left bottom, left top, color-stop(0.5, @startColor), color-stop(0.51, @startColor));
background-repeat: repeat-x;
}
}