我正在开发一个 gnome-shell 扩展,但我无法让线性渐变正常工作(或者实际上根本没有)。GTK文档或这篇文章指出我们应该能够使用这样的东西:
label {
background-image: linear-gradient(to top right, blue 20%, #f0f 80%);
/*OR*/
background-image: -gtk-gradient (linear,
0 0, 0 1,
color-stop(0, @yellow),
color-stop(0.2, @blue),
color-stop(1, #0f0));
}
但它不起作用,渐变不显示。
到目前为止,我可以获得渐变的唯一方法是使用这些未记录的属性:
label {
background-gradient-start: rgba(255, 0, 0, 1);
background-gradient-end: rgba(0, 255, 0, 1);
}
问题是我需要使用线性梯度函数来微调梯度。可能吗?