Apply custom text colors for emphasis, branding, and visual hierarchy. Colors preserve perfectly through Word import/export, maintaining your document’s visual design across formats.

OOXML Structure

<w:r>
  <w:rPr>
    <w:color w:val="FF0000"/>
  </w:rPr>
  <w:t>Red colored text</w:t>
</w:r>

Why you’d use this

  • Status indicators - Red for errors, green for success, yellow for warnings
  • Document sections - Color-code different types of content
  • Emphasis - Draw attention without changing font size or weight
  • Brand consistency - Match company colors in documents
  • Legal markup - Highlight changes, additions, deletions

Best practices

  • Accessibility - Ensure sufficient contrast ratios (WCAG 2.1 AA: 4.5:1)
  • Print-friendly - Test colors in both digital and printed formats
  • Consistency - Use the same color for the same meaning throughout
  • Restraint - Too many colors reduce effectiveness
  • Fallbacks - Don’t rely solely on color to convey meaning

Options

Configure the extension behavior:
types
Array.<string>
default:"['textStyle']"
Mark types to add color support to
Usage:
Color.configure({
  resizable: false,
  cellMinWidth: 50
})

Attributes

color
ColorValue
Text color value

Commands

setColor

Set text color
Preserves other text styling attributes
// Set to red using hex
setColor('#ff0000')

// Set using rgb
setColor('rgb(255, 0, 0)')

// Set using named color
setColor('blue')
Parameters:
color
ColorValue
required
See ColorValue type definition

unsetColor

Remove text color
Removes color while preserving other text styles
unsetColor()

Types

ColorValue

Accepts hex colors (#ff0000), rgb(255,0,0), or named colors (red)