(node, warpObj)
| 179 | } |
| 180 | |
| 181 | export function getGradientFill(node, warpObj) { |
| 182 | const gsLst = node['a:gsLst']['a:gs'] |
| 183 | const colors = [] |
| 184 | for (let i = 0; i < gsLst.length; i++) { |
| 185 | const lo_color = getSolidFill(gsLst[i], undefined, undefined, warpObj) |
| 186 | const pos = getTextByPathList(gsLst[i], ['attrs', 'pos']) |
| 187 | |
| 188 | colors[i] = { |
| 189 | pos: pos ? (pos / 1000 + '%') : '', |
| 190 | color: lo_color, |
| 191 | } |
| 192 | } |
| 193 | const lin = node['a:lin'] |
| 194 | let rot = 0 |
| 195 | let pathType = 'line' |
| 196 | if (lin) rot = angleToDegrees(lin['attrs']['ang']) |
| 197 | else { |
| 198 | const path = node['a:path'] |
| 199 | if (path && path['attrs'] && path['attrs']['path']) pathType = path['attrs']['path'] |
| 200 | } |
| 201 | return { |
| 202 | rot, |
| 203 | path: pathType, |
| 204 | colors: colors.sort((a, b) => parseInt(a.pos) - parseInt(b.pos)), |
| 205 | } |
| 206 | } |
| 207 | |
| 208 | export function getPatternFill(node, warpObj) { |
| 209 | if (!node) return null |
no test coverage detected