(bgPr, phClr, slideMasterContent, warpObj)
| 235 | } |
| 236 | |
| 237 | export function getBgGradientFill(bgPr, phClr, slideMasterContent, warpObj) { |
| 238 | if (bgPr) { |
| 239 | const grdFill = bgPr['a:gradFill'] |
| 240 | const gsLst = grdFill['a:gsLst']['a:gs'] |
| 241 | const colors = [] |
| 242 | |
| 243 | for (let i = 0; i < gsLst.length; i++) { |
| 244 | const lo_color = getSolidFill(gsLst[i], slideMasterContent['p:sldMaster']['p:clrMap']['attrs'], phClr, warpObj) |
| 245 | const pos = getTextByPathList(gsLst[i], ['attrs', 'pos']) |
| 246 | |
| 247 | colors[i] = { |
| 248 | pos: pos ? (pos / 1000 + '%') : '', |
| 249 | color: lo_color, |
| 250 | } |
| 251 | } |
| 252 | const lin = grdFill['a:lin'] |
| 253 | let rot = 0 |
| 254 | let pathType = 'line' |
| 255 | if (lin) rot = angleToDegrees(lin['attrs']['ang']) + 0 |
| 256 | else { |
| 257 | const path = grdFill['a:path'] |
| 258 | if (path && path['attrs'] && path['attrs']['path']) pathType = path['attrs']['path'] |
| 259 | } |
| 260 | return { |
| 261 | rot, |
| 262 | path: pathType, |
| 263 | colors: colors.sort((a, b) => parseInt(a.pos) - parseInt(b.pos)), |
| 264 | } |
| 265 | } |
| 266 | else if (phClr) { |
| 267 | return phClr.indexOf('#') === -1 ? `#${phClr}` : phClr |
| 268 | } |
| 269 | return null |
| 270 | } |
| 271 | |
| 272 | export async function getSlideBackgroundFill(warpObj) { |
| 273 | const slideContent = warpObj['slideContent'] |
no test coverage detected