Skip to content

Scheme Color Tagname in xml does not Match with MSO_THEME_COLOR_INDEX #634

@zhar97

Description

@zhar97

I was also attempting to grab the scheme color value as the following:

from pptx.opc.constants import RELATIONSHIP_TYPE as RT
from pptx.oxml import parse_xml

slide_master = slide.slide_layout.slide_master
slide_master_part = slide_master.part
theme_part = slide_master_part.part_related_by(RT.THEME)

theme = parse_xml(theme_part.blob)  # theme here is an <a:theme> element
srgbClr = theme.xpath('a:themeElements/a:clrScheme/a:accent1/a:srgbClr/@val')[0]
print(srgbClr)  

Originally posted by @scanny in #308 (comment)

However, I noticed an anomaly of mismatching between the actual scheme color index (from loaded .pptx) and the child tagname of <a:clrScheme>.

For example,
FillFormat.fore_color.theme_color return BACKGROUND_1
meanwhile the xml actually stored the color value under <a:lt1> which actually corresponds to LIGHT_1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions