diff --git a/src/gen-utils.ts b/src/gen-utils.ts index a3b1b30ab..2c9f3405c 100644 --- a/src/gen-utils.ts +++ b/src/gen-utils.ts @@ -190,22 +190,22 @@ export function createGlowElement(options: TextGlowProps, defaults: TextGlowProp /** * Create color selection - * @param shapeFill - options + * @param {Color | ShapeFillProps | ShapeLineProps} props fill props * @returns XML string */ -export function genXmlColorSelection(shapeFill: Color | ShapeFillProps | ShapeLineProps): string { - let colorVal = '' +export function genXmlColorSelection(props: Color | ShapeFillProps | ShapeLineProps): string { let fillType = 'solid' + let colorVal = '' let internalElements = '' let outText = '' - if (shapeFill) { - if (typeof shapeFill === 'string') colorVal = shapeFill + if (props) { + if (typeof props === 'string') colorVal = props else { - if (shapeFill.type) fillType = shapeFill.type - if (shapeFill.color) colorVal = shapeFill.color - if (shapeFill.alpha) internalElements += `` // DEPRECATED: @deprecated v3.3.0 - if (shapeFill.transparency) internalElements += `` + if (props.type) fillType = props.type + if (props.color) colorVal = props.color + if (props.alpha) internalElements += `` // DEPRECATED: @deprecated v3.3.0 + if (props.transparency) internalElements += `` } switch (fillType) { diff --git a/src/gen-xml.ts b/src/gen-xml.ts index d60b6cfb3..524fce9d3 100644 --- a/src/gen-xml.ts +++ b/src/gen-xml.ts @@ -474,7 +474,7 @@ function slideObjectToXml(slide: PresSlide | SlideLayout): string { // shape Type: LINE: line color if (slideItemObj.options.line) { strSlideXml += slideItemObj.options.line.width ? `` : '' - strSlideXml += genXmlColorSelection(slideItemObj.options.line) + if (slideItemObj.options.line.color) strSlideXml += genXmlColorSelection(slideItemObj.options.line) if (slideItemObj.options.line.dashType) strSlideXml += `` if (slideItemObj.options.line.beginArrowType) strSlideXml += `` if (slideItemObj.options.line.endArrowType) strSlideXml += ``