From 6ba42c36e463be145c8cf4ce34247288c1f02334 Mon Sep 17 00:00:00 2001 From: MartinPacker Date: Sat, 25 Mar 2023 17:27:54 +0000 Subject: [PATCH] CardDividerColour - RGB & Theme --- md2pptx | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/md2pptx b/md2pptx index 3b09b3f..1b23404 100755 --- a/md2pptx +++ b/md2pptx @@ -2703,6 +2703,7 @@ def createListBlock(slideInfo, slide, renderingRectangle): cardBorderColour = processingOptions.getCurrentOption("cardbordercolour") cardTitleColour = processingOptions.getCurrentOption("cardtitlecolour") cardColours = processingOptions.getCurrentOption("cardcolour") + cardDividerColour = processingOptions.getCurrentOption("carddividercolour") marginBase = processingOptions.getCurrentOption("marginBase") pageTitleSize = processingOptions.getCurrentOption("pageTitleSize") pageSubtitleSize = processingOptions.getCurrentOption("pageSubtitleSize") @@ -2970,8 +2971,13 @@ def createListBlock(slideInfo, slide, renderingRectangle): slide.shapes, ) + if cardDividerColour != ("None", ""): + colourType, dividerColour = cardDividerColour + if colourType == "Theme": + dividingLine.line.color.theme_color = dividerColour + else: + dividingLine.line.color.rgb = RGBColor.from_string(dividerColour[1:]) - dividingLine.line.color.rgb = RGBColor(0, 0, 0) dividingLine.line.width = Pt(2.0) # Position card @@ -4875,6 +4881,7 @@ processingOptions.setOptionValuesArray( ["cardBorderColour", ("None", "")], ["cardTitleColour", ("None", "")], ["cardColour", [("None", "")]], + ["cardDividerColour", ("RGB", "#000000")], ] ) @@ -5214,6 +5221,12 @@ for line in metadata_lines: else: processingOptions.setOptionValues("cardTitleColour", ("Theme", parseThemeColour(value))) + elif (name == "carddividercolour") | (name == "carddividercolor"): + if value[0] == "#": + processingOptions.setOptionValues("cardDividerColour", ("RGB", value)) + else: + processingOptions.setOptionValues("cardDividerColour", ("Theme", parseThemeColour(value))) + elif name == "cardborderwidth": processingOptions.setOptionValues(name, float(value))