Report templatesFunctions
cellBackgroundRender
Get cell background color for rendering risk levels with predefined color scheme
Usage
The cellBackgroundRender function returns a cell background color style object based on risk severity using a specific color scheme optimized for rendering.
Syntax
{riskLevel | cellBackgroundRender}Parameters
input(string): The risk level - one of: "Critical", "High", "Medium", "Low", "Informational"
Returns
- An object with
cellBackgroundproperty containing the hex color code nullif input is null or doesn't match any risk level
Color Mapping
| Risk Level | Background Color | Description |
|---|---|---|
| Critical | #0b0606 | Very dark red/black |
| High | #e5301e | Bright red |
| Medium | #f3bb33 | Orange/amber |
| Low | #ffff6e | Light yellow |
| Informational | #b7b7b7 | Light gray |
Examples
Basic usage
{"High" | cellBackgroundRender}
// Returns: { cellBackground: "#e5301e" }In vulnerability tables
{vulnerability.risk | cellBackgroundRender}
// Applies appropriate background color for risk levelNull handling
{null | cellBackgroundRender}
// Returns: nullCritical risk
{"Critical" | cellBackgroundRender}
// Returns: { cellBackground: "#0b0606" }Use Cases
- Risk severity visualization in rendered reports
- Color-coded vulnerability tables
- Security dashboard indicators
- Executive summary risk highlighting
- Compliance status visual indicators
Difference from riskBackgroundColor
This function uses a different color palette optimized for better readability in rendered documents, with more subtle color variations compared to riskBackgroundColor.