Report templatesFunctions

riskBackgroundColor

Get cell background color style based on risk severity level

Usage

The riskBackgroundColor function returns a cell background color style object based on the risk severity level for use in Word documents.

Syntax

{riskLevel | riskBackgroundColor}

Parameters

  • input (string): The risk level - one of: "Critical", "High", "Medium", "Low", "Informational"

Returns

An object with cellBackground property containing the hex color code, or undefined if input doesn't match

Color Mapping

Risk LevelBackground Color
Critical#000000 (Black)
High#ff0000 (Red)
Medium#ffc000 (Orange)
Low#00b050 (Green)
Informational#ffffff (White)

Examples

Basic usage

{"High" | riskBackgroundColor}
// Returns: { cellBackground: "#ff0000" }

In table cells

{vulnerability.severity | riskBackgroundColor}
// Returns appropriate background color for vulnerability severity

Critical risk

{"Critical" | riskBackgroundColor}
// Returns: { cellBackground: "#000000" }

With conditional logic

{assessment.overallRisk | riskBackgroundColor}
// Applies color based on overall risk assessment

Use Cases

  • Risk matrices in Word documents
  • Vulnerability severity highlighting in tables
  • Executive summary risk indicators
  • Color-coded security dashboards
  • Compliance status reporting with visual indicators