|
|

楼主 |
发表于 2026-5-28 21:03
|
显示全部楼层
svg 核心代码:
- <svg width="400" height="400" xmlns="http://www.w3.org/2000/svg" viewBox="-200 -200 400 400">
- <defs id="defs">
- <radialGradient id="grd" cx="30%" cy="25%" r="70%">
- <stop offset="0%" stop-color="#eff"></stop>
- <stop offset="50%" stop-color="#4da6ff"></stop>
- <stop offset="100%" stop-color="#003d82"></stop>
- </radialGradient>
- </defs>
- <circle cx="0" cy="0" r="180" fill="url(#grd)"></circle>
- </svg>
复制代码 svgdr绘制指令:
- dr.setsvg({width: 400, height: 400, viewBox: '-200 -200 400 400'});
- dr.defs('defs');
- dr.gradient('radialGradient', {id: 'grd', cx: '30%', cy: '25%', r: '70%'}, '<stop offset="0%" stop-color="#eff" /><stop offset="50%" stop-color="#4da6ff" /><stop offset="100%" stop-color="#003d82" />');
- dr.circle(0, 0, 180, 'url(#grd)');
复制代码 svgdr 指令可以到这里运行: svgdr on line
|
|