Skip to main content
This page has thin source coverage. The color mechanisms documented below are derived from the sheet configuration sample and the AppConfig.ts source. Additional color options may be available in your Risksheet version. Verify specific color classes and decorator behaviors in your application.

Configuration Architecture

Item colors in Risksheet follow a three-layer architecture. Each layer serves a distinct purpose, and all three work together to produce the final visual appearance of cells and rows.
diagram

The styles Property

The styles property defines named CSS class rules that control visual appearance. Each entry maps a CSS class name to a set of CSS properties.

Style Definition Format

Each key in the styles object is a CSS class name (prefixed with .), and the value is a CSS declaration block wrapped in curly braces {}:

Risk Priority Number (RPN) Styles

The following built-in style classes implement a three-tier risk color scheme based on RPN thresholds.
All RPN style classes use !important to override default cell styling. This ensures risk color indicators are always visible regardless of other CSS rules that may apply to the cell.

RPN Style Configuration

Column Group Header Styles

Styles can target specific column group headers by combining row position selectors with header group CSS classes. These styles apply to the column header area, not to data cells.
The headSysReq and headFinalRanking classes are applied to column groups via the headerGroupCss property on column definitions. You assign these classes when configuring column groups to enable targeted header styling.

The cellDecorators Property

Cell decorators are JavaScript functions that dynamically apply CSS classes to cells based on their current values or the parent item’s properties. They execute each time a cell is rendered, ensuring colors always reflect the current data.

Cell Decorator Function Signature

Each cell decorator receives an info object with the following properties:

RPN Cell Decorator

The rpn cell decorator applies risk-level color classes to RPN cells based on value thresholds:
Logic breakdown:

Row Header RPN Decorator

The rowHeaderRpnNew cell decorator applies the same RPN color scheme to row headers based on the revised (post-mitigation) RPN value stored in the rpnNew field:
Unlike the rpn decorator which uses info.value (the cell’s own value), the rowHeaderRpnNew decorator uses info.item['rpnNew'] to read the revised RPN from the item data. This means the row header color reflects the post-mitigation risk level regardless of which cell triggered the render.

Row Header Renderer

The row header renderer is a named function that controls the visual appearance of the row header column (the leftmost column showing work item identifiers).

Row Header Configuration

The renderer value references a cell decorator by name. In the example above, rowHeaderRpnNew causes each row header to be colored based on the revised RPN value of the corresponding risk item. This gives users an immediate visual summary of risk levels without scanning individual columns.

Applying Colors to Columns

To connect cell decorators to specific columns, reference the decorator name in your column configuration. The decorator is applied every time a cell in that column is rendered. A column references a cell decorator via its cellRenderer property. Set cellRenderer to the decorator name — for example, cellRenderer: "rpn" applies the decorator named rpn to that column. As described in Cell Decorators, a decorator may also auto-match a column when the decorator’s name equals the column id.

Typical Column-to-Decorator Mapping

In an FMEA configuration, RPN columns reference the rpn cell decorator:

Custom Color Schemes

You can define custom color schemes by creating new style classes and cell decorator functions. The general pattern is:
  1. Define CSS classes in styles with your desired colors
  2. Create a JavaScript function in cellDecorators that applies those classes based on data conditions
  3. Reference the decorator in the appropriate column configuration

Example: Custom Severity Color Scheme

Color Behavior in Export

Cell colors applied through styles and cellDecorators have different behaviors across export formats:
The exact behavior of custom styles in PDF and Excel exports depends on the export script configuration. Colors defined with !important are more likely to be preserved. Check your pdfscript.js for custom export formatting logic.

Complete Example

A complete sheet configuration demonstrating all item color mechanisms for an FMEA risk analysis:
Last modified on July 10, 2026