您需要定义颜色的位置
colors="#ff000040 #ff000010" positions="0 1"
三种颜色会是这样的
colors="#000000 #ffff00 #ffffff" positions="0 0.5 1"
这应该可以解决您的问题:)