ColorFormat object provides access to color properties for fills, lines, and fonts. It supports RGB colors, theme colors, and brightness adjustments.
Usage
ColorFormat Properties
Read/write float value between -1.0 and 1.0 indicating brightness adjustment.
- Negative values make the color darker (e.g., -0.25 is 25% darker)
- Positive values make the color lighter (e.g., 0.4 is 40% lighter)
- 0 means no brightness adjustment
ValueError if color type is None. Set rgb or theme_color first.RGBColor value of this color, or None if no RGB color is defined.Setting this value to an RGBColor instance causes the color type to change to
MSO_COLOR_TYPE.RGB. Any brightness adjustment on a theme color is removed when changing to RGB.Theme color value from the
MSO_THEME_COLOR enumeration.Examples: MSO_THEME_COLOR.ACCENT_1, MSO_THEME_COLOR.DARK_1Raises AttributeError if accessed when color is not type MSO_COLOR_TYPE.SCHEME. Assigning a theme color value causes the color’s type to change to MSO_COLOR_TYPE.SCHEME.Read-only. The type of this color definition.Values from
MSO_COLOR_TYPE enumeration:MSO_COLOR_TYPE.RGB- Defined by RGB valuesMSO_COLOR_TYPE.SCHEME- Defined by theme colorMSO_COLOR_TYPE.HSL- Defined by hue, saturation, luminanceMSO_COLOR_TYPE.PRESET- Preset color nameMSO_COLOR_TYPE.SCRGB- ScRGB color spaceMSO_COLOR_TYPE.SYSTEM- System colorNone- No color defined
RGBColor
Immutable value object defining a particular RGB color.Constructor
Red component (0-255)
Green component (0-255)
Blue component (0-255)