ASILPalette

ASIL color palette.

Returned hex values are generic and can be used in DOT attributes (color, fontcolor, fillcolor) or any other renderer.

Types

Link copied to clipboard
data class ColorSet(val edgeHex: String, val fontHex: String, val fillHex: String)
Link copied to clipboard

Properties

Link copied to clipboard

Single source of truth for the cascading-fault highlight colour — the violet used for legacy/edge-level cascading-fault highlights where a lower-ASIL predecessor feeds a higher-ASIL sink.

Link copied to clipboard

Functions

Link copied to clipboard
fun asEsm(): String

Emits the full palette as an ES-module source string. Used by the Gradle stigGenerateAsilPaletteJs task to produce stig-asil-palette.generated.js under js-vendor/src/, which the cytoscape JS scripts then import — keeping the hex values in a single source of truth.

Link copied to clipboard
fun colorForLevel(asil: ASIL?, level: Int, maxLevel: Int = DIAGRAM_LEVEL_MAX, style: ASILPalette.Style = defaultStyle): String

Fill colour for any node on the unified top-down hierarchy scale (ElementType.hierarchyLevel / CodeConstructKind.hierarchyLevel): Vehicle 0 … Component/Activity 5 … Instruction DIAGRAM_LEVEL_MAX.

Link copied to clipboard
fun desaturatedFillHex(asil: ASIL?, whiteRatio: Double, style: ASILPalette.Style = defaultStyle): String

Returns the ASIL's fill colour blended toward white by whiteRatio (0.0 = original colour, 1.0 = pure white). Used by the DOT pipeline to give nested cluster boxes the same ASIL hue as their contents but with progressively lower saturation:

Link copied to clipboard
fun edgeHex(asil: ASIL?, style: ASILPalette.Style = defaultStyle): String
Link copied to clipboard
fun fillHex(asil: ASIL?, style: ASILPalette.Style = defaultStyle): String
Link copied to clipboard
fun fontHex(asil: ASIL?, style: ASILPalette.Style = defaultStyle): String
Link copied to clipboard
fun forAsil(asil: ASIL?, style: ASILPalette.Style = defaultStyle): ASILPalette.ColorSet
Link copied to clipboard
Generated with STIG