riskBackgroundColor
The riskBackgroundColor function returns a cell background color style object based on the risk severity level for use in Word documents.
Syntax
Section titled “Syntax”{riskLevel | riskBackgroundColor}Parameters
Section titled “Parameters”input(string): The risk level - one of: “Critical”, “High”, “Medium”, “Low”, “Informational”
Returns
Section titled “Returns”An object with cellBackground property containing the hex color code, or undefined if input doesn’t match
Color Mapping
Section titled “Color Mapping”| Risk Level | Background Color |
|---|---|
| Critical | #000000 (Black) |
| High | #ff0000 (Red) |
| Medium | #ffc000 (Orange) |
| Low | #00b050 (Green) |
| Informational | #ffffff (White) |
Examples
Section titled “Examples”Basic usage
Section titled “Basic usage”{"High" | riskBackgroundColor}// Returns: { cellBackground: "#ff0000" }In table cells
Section titled “In table cells”{vulnerability.severity | riskBackgroundColor}// Returns appropriate background color for vulnerability severityCritical risk
Section titled “Critical risk”{"Critical" | riskBackgroundColor}// Returns: { cellBackground: "#000000" }With conditional logic
Section titled “With conditional logic”{assessment.overallRisk | riskBackgroundColor}// Applies color based on overall risk assessmentUse Cases
Section titled “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