ColorFormat
paper-docx 0.2.0 API reference
Provides access to color settings like RGB color, theme color, and luminance adjustments.
ColorFormat(rPr_parent: RPrParent)Attributes
element
attributeelementThe lxml element proxied by this object.
part
attributepartXmlPartThe package part containing this object.
rgb
attributergbRGBColor | NoneAn RGBColor value or None if no RGB color is specified.
When :attr:type is MSO_COLOR_TYPE.RGB, the value of this property will always be an
RGBColor value. It may also be an RGBColor value if :attr:type is
MSO_COLOR_TYPE.THEME, as Word writes the current value of a theme color when one is
assigned. In that case, the RGB value should be interpreted as no more than a good guess
however, as the theme color takes precedence at rendering time. Its value is None
whenever :attr:type is either None or MSO_COLOR_TYPE.AUTO.
Assigning an RGBColor value causes :attr:type to become MSO_COLOR_TYPE.RGB and any
theme color is removed. Assigning None causes any color to be removed such that the
effective color is inherited from the style hierarchy.
theme_color
attributetheme_colorMSO_THEME_COLOR | NoneMember of :ref:MsoThemeColorIndex or None if no theme color is specified.
When :attr:type is MSO_COLOR_TYPE.THEME, the value of this property will always be a
member of :ref:MsoThemeColorIndex. When :attr:type has any other value, the value of
this property is None.
Assigning a member of :ref:MsoThemeColorIndex causes :attr:type to become
MSO_COLOR_TYPE.THEME. Any existing RGB value is retained but ignored by Word. Assigning
None causes any color specification to be removed such that the effective color is
inherited from the style hierarchy.
type
attributetypeMSO_COLOR_TYPE | NoneRead-only.
A member of :ref:MsoColorType, one of RGB, THEME, or AUTO, corresponding to the way this
color is defined. Its value is None if no color is applied at this level, which causes
the effective color to be inherited from the style hierarchy.