The left side of the rectangle specifies the starting point of the linear gradient , and the right side of the rectangle specifies the endpoint 矩形的左侧指定线性渐变的起始点,矩形的右侧指定线性渐变的终结点。
By default , a two - color linear gradient is an even horizontal linear blend from the starting color to the ending color along the specified line 默认情况下,双色渐变是沿指定直线从起始色到结束色的均匀水平线性混合。
Arrays are 0 . 2 and 0 . 3 , respectively , for a linear gradient from blue to red along a 100 - pixel line , the color 20 pixels along that line 20 percent of the distance consists of 30 percent blue and 70 percent red 数组的相应元素分别为0 . 2和0 . 3 ,对于从蓝到红沿100像素线的线性渐变,沿该直线20像素处的颜色(该距离的20 )由30的蓝和70的红组成。