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 cellBackground property containing the hex color code
  • null if input is null or doesn't match any risk level

Color Mapping

Risk LevelBackground ColorDescription
Critical#0b0606Very dark red/black
High#e5301eBright red
Medium#f3bb33Orange/amber
Low#ffff6eLight yellow
Informational#b7b7b7Light gray

Examples

Basic usage

{"High" | cellBackgroundRender}
// Returns: { cellBackground: "#e5301e" }

In vulnerability tables

{vulnerability.risk | cellBackgroundRender}
// Applies appropriate background color for risk level

Null handling

{null | cellBackgroundRender}
// Returns: null

Critical 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.