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.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 thestyles 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.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 aninfo object with the following properties:
RPN Cell Decorator
Therpn cell decorator applies risk-level color classes to RPN cells based on value thresholds:
Row Header RPN Decorator
TherowHeaderRpnNew cell decorator applies the same RPN color scheme to row headers based on the revised (post-mitigation) RPN value stored in the rpnNew field:
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
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 itscellRenderer 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 therpn cell decorator:
Custom Color Schemes
You can define custom color schemes by creating new style classes and cell decorator functions. The general pattern is:- Define CSS classes in
styleswith your desired colors - Create a JavaScript function in
cellDecoratorsthat applies those classes based on data conditions - Reference the decorator in the appropriate column configuration
Example: Custom Severity Color Scheme
Color Behavior in Export
Cell colors applied throughstyles 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:Related Pages
- Cell Decorators — full reference for the
cellDecoratorsconfiguration property - CSS Classes — complete list of built-in and custom CSS classes
- Conditional Formatting — overview of all conditional formatting mechanisms
- Configuration Properties Index — full property reference including
styles,cellDecorators, andheaders - PDF Export API — how colors are handled during PDF export