Skip to content

Commit

Permalink
CardDividerColour - RGB & Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPacker committed Mar 25, 2023
1 parent 443919a commit 6ba42c3
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion md2pptx
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -4875,6 +4881,7 @@ processingOptions.setOptionValuesArray(
["cardBorderColour", ("None", "")],
["cardTitleColour", ("None", "")],
["cardColour", [("None", "")]],
["cardDividerColour", ("RGB", "#000000")],
]
)

Expand Down Expand Up @@ -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))

Expand Down

0 comments on commit 6ba42c3

Please sign in to comment.