a:grpFill (Group Fill)
Specifies that a shape inherits fill properties from its parent group shape.
Description
\:grpFill\ is the DrawingML element that applies fill inherited from the parent group shape. It is defined in ECMA-376 Part 1 §20.1.8.26.
Group fill enables shapes within a grouped set to automatically use the fill properties of their parent group, creating visual cohesion. This is essential for:
- Creating grouped shapes with uniform appearance
- Maintaining visual consistency in shape collections
- Enabling theme-based fill changes across entire groups
- Reducing file size by eliminating redundant fill specifications
- Facilitating master slide design patterns
Group fill differs from:
- Solid fill (\:solidFill) — Direct color fill
- No fill (\:noFill) — No fill, overrides inheritance
- Inherited fill (omitted) — Implicit inheritance from master/theme
Attributes
| Attribute | Type | Values | Description |
|---|---|---|---|
| (none) | - | - | \:grpFill\ has no attributes or child elements. |
Content Model
\:grpFill\ has no child elements. It is an empty, self-contained element:
xml
<a:grpFill/>
Examples
Grouped Shapes with Inherited Fill
<a:grpSp>
<a:grpSpPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="10000000" cy="7500000"/>
<a:chOff x="0" y="0"/>
<a:chExt cx="10000000" cy="7500000"/>
</a:xfrm>
<a:solidFill><a:srgbClr val="4472C4"/></a:solidFill>
</a:grpSpPr>
<a:sp>
<a:spPr>
<a:xfrm><a:off x="500000" y="500000"/><a:ext cx="2000000" cy="2000000"/></a:xfrm>
<a:grpFill/>
</a:spPr>
</a:sp>
</a:grpSp>
using DocumentFormat.OpenXml.Drawing;
var groupShape = new GroupShape();
// Group properties with blue fill
var grpSpPr = new GroupShapeProperties();
var transform = new Transform2D();
transform.Append(new Offset { X = 0, Y = 0 });
transform.Append(new Extents { Cx = 10000000, Cy = 7500000 });
transform.Append(new ChildOffset { X = 0, Y = 0 });
transform.Append(new ChildExtents { Cx = 10000000, Cy = 7500000 });
grpSpPr.Append(transform);
var solidFill = new SolidFill();
solidFill.Append(new RgbColorModelHex { Val = "4472C4" });
grpSpPr.Append(solidFill);
groupShape.Append(grpSpPr);
// Child shape inherits fill
var shape = new Shape();
var spPr = new ShapeProperties();
var spTransform = new Transform2D();
spTransform.Append(new Offset { X = 500000, Y = 500000 });
spTransform.Append(new Extents { Cx = 2000000, Cy = 2000000 });
spPr.Append(spTransform);
spPr.Append(new GroupFill()); // Inherit from group
shape.Append(spPr);
groupShape.Append(shape);
Mixed Fills in Group (Some Inherit, Some Override)
<a:grpSp>
<a:grpSpPr>
<a:solidFill><a:srgbClr val="ED7D31"/></a:solidFill>
</a:grpSpPr>
<a:sp>
<a:spPr>
<!-- Shape 1: Inherits orange fill from group -->
<a:grpFill/>
</a:spPr>
</a:sp>
<a:sp>
<a:spPr>
<!-- Shape 2: Overrides with green -->
<a:solidFill><a:srgbClr val="70AD47"/></a:solidFill>
</a:spPr>
</a:sp>
</a:grpSp>
var groupShape = new GroupShape();
var grpSpPr = new GroupShapeProperties();
var orangeFill = new SolidFill();
orangeFill.Append(new RgbColorModelHex { Val = "ED7D31" });
grpSpPr.Append(orangeFill);
groupShape.Append(grpSpPr);
// Shape 1: inherits orange
var shape1 = new Shape();
var spPr1 = new ShapeProperties();
spPr1.Append(new GroupFill());
shape1.Append(spPr1);
groupShape.Append(shape1);
// Shape 2: overrides with green
var shape2 = new Shape();
var spPr2 = new ShapeProperties();
var greenFill = new SolidFill();
greenFill.Append(new RgbColorModelHex { Val = "70AD47" });
spPr2.Append(greenFill);
shape2.Append(spPr2);
groupShape.Append(shape2);
Theme-Based Group Fill (Using Scheme Color)
<a:grpSp>
<a:grpSpPr>
<a:solidFill>
<a:schemeClr val="accent1"/>
</a:solidFill>
</a:grpSpPr>
<a:sp>
<a:spPr>
<a:grpFill/>
</a:spPr>
</a:sp>
</a:grpSp>
var groupShape = new GroupShape();
var grpSpPr = new GroupShapeProperties();
var themeFill = new SolidFill();
var schemeClr = new SchemeColor { Val = ColorSchemeIndexValues.Accent1 };
themeFill.Append(schemeClr);
grpSpPr.Append(themeFill);
groupShape.Append(grpSpPr);
var shape = new Shape();
var spPr = new ShapeProperties();
spPr.Append(new GroupFill()); // Inherits theme color
shape.Append(spPr);
groupShape.Append(shape);
Fill Inheritance Behavior
Fill Inheritance Chain
When a shape specifies \:grpFill\, fill resolves in this order:
- Shape explicit fill (e.g., \:solidFill\, \:noFill) — Direct specification
- Group fill (\:grpFill) — Parent group’s fill
- Master slide theme — Theme-defined fill
- Default — No fill (transparent)
Precedence Table
| Scenario | Result | Notes |
|---|---|---|
| Shape has \:solidFill\ | Uses solid fill | Direct specification wins |
| Shape has \:grpFill\ | Inherits group fill | Uses parent’s fill properties |
| Shape has \:noFill\ | No fill (transparent) | Explicit override |
| Shape omits fill | Inherits from theme | Implicit theme inheritance |
Usage Patterns
When to Use Group Fill
| Scenario | Why |
|---|---|
| Grouped icons | All shapes same color, coordinated appearance |
| Themed collections | Shapes update with master slide color changes |
| Organizational charts | Hierarchy with consistent styling |
| Data visualization | Grouped data points with consistent coloring |
| Templates | Placeholder shapes that inherit design colors |
Example: Organizational Chart
`xml
`
Interactions with Other Elements
Group Fill + Outline
Group fill controls interior fill; outline (\:ln) remains independent:
<a:grpSp>
<a:grpSpPr>
<a:solidFill><a:srgbClr val="4472C4"/></a:solidFill>
</a:grpSpPr>
<a:sp>
<a:spPr>
<a:grpFill/>
<a:ln w="19050"><a:solidFill><a:srgbClr val="000000"/></a:solidFill></a:ln>
</a:spPr>
</a:sp>
</a:grpSp>
var grpFill = new GroupFill();
var line = new Outline { Width = 19050 };
var lineFill = new SolidFill();
lineFill.Append(new RgbColorModelHex { Val = "000000" });
line.Append(lineFill);
var spPr = new ShapeProperties();
spPr.Append(grpFill); // Inherits blue fill
spPr.Append(line); // Has black outline
File Size Optimization
Using \:grpFill\ for grouped shapes reduces file size:
Without Group Fill (each shape specifies fill):
`
With Group Fill (1 group fill + inherited):
`
Result: Smaller file size, easier maintenance
Notes
Element Characteristics
- Empty element: No child elements
- Inheritance marker: Signals “use parent fill”
- Scope: Only affects current shape, not nested groups
- Mutually exclusive: Cannot combine with other fill types
- Overridable: Any explicit fill in shape overrides group fill
Rendering
- Word: Uses group fill color consistently
- PowerPoint: Inherits group properties; updates with theme changes
- Excel: Group fill applied to shape collection
- Publisher: Propagates fill to all grouped objects
Compatibility
- Office 2007 and later
- Consistent across applications
- Theme-based inheritance works across presentations
Best Practices
- Use group fill for visual cohesion in grouped shapes
- Leverage theme colors (\:schemeClr) in group for dynamic theming
- Override with explicit fills only when necessary
- Document grouped structure for maintenance
- Use for templates and master slides