cellBackgroundRender
The cellBackgroundRender function returns a cell background color style object based on risk severity using a specific color scheme optimized for rendering.
Syntax
Section titled “Syntax”{riskLevel | cellBackgroundRender}Parameters
Section titled “Parameters”input(string): The risk level - one of: “Critical”, “High”, “Medium”, “Low”, “Informational”
Returns
Section titled “Returns”- An object with
cellBackgroundproperty containing the hex color code nullif input is null or doesn’t match any risk level
Color Mapping
Section titled “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
Section titled “Examples”Basic usage
Section titled “Basic usage”{"High" | cellBackgroundRender}// Returns: { cellBackground: "#e5301e" }In vulnerability tables
Section titled “In vulnerability tables”{vulnerability.risk | cellBackgroundRender}// Applies appropriate background color for risk levelNull handling
Section titled “Null handling”{null | cellBackgroundRender}// Returns: nullCritical risk
Section titled “Critical risk”{"Critical" | cellBackgroundRender}// Returns: { cellBackground: "#0b0606" }Use Cases
Section titled “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
Section titled “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.