zhangwei
2025-03-07 d3e6dd6b3032c119676efa1e9fcee3a8a8043fc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 本文件由FirstUI授权予四川政采招投标咨询有限公司(会员ID:  163,营业执照号:9151     0 1  31  332   0 0 6 19 3K)专用,请尊重知识产权,勿私下传播,违者追究法律责任。
class FillStyleLinearGradient {
 
    constructor(x0, y0, x1, y1) {
        this._start_pos = { _x: x0, _y: y0 };
        this._end_pos = { _x: x1, _y: y1 };
        this._stop_count = 0;
        this._stops = [0, 0, 0, 0, 0];
    }
 
    addColorStop = function (pos, color) {
        if (this._stop_count < 5 && 0.0 <= pos && pos <= 1.0) {
            this._stops[this._stop_count] = { _pos: pos, _color: color };
            this._stop_count++;
        }
    }
}
 
export default FillStyleLinearGradient;