Interface: ViewerTheme
Defined in: src/display/ViewerTheme.ts:20
Runtime-changeable colours of a slice viewer's stage and annotations.
Every field is optional; omitted fields keep their current value, so a theme switch can be expressed as a partial update. Apply with setTheme() on SimpleOrthogonalViewer, OrthogonalImageViewer, SingleSliceViewer or SliceViewer; no viewer rebuild is needed.
Example
ts
viewer.setTheme({
backgroundColor: 0xfafaf7,
crosshair: { crossColor: 0x1c2226, crossAlpha: 0.55, haloColor: 0xffffff, haloAlpha: 0.6 },
orientationLabels: { color: 0x3e4952, alpha: 0.9, shadowAlpha: 0 },
});Properties
backgroundColor?
ts
optional backgroundColor?: number;Defined in: src/display/ViewerTheme.ts:22
Canvas clear colour (PIXI numeric colour).
backgroundAlpha?
ts
optional backgroundAlpha?: number;Defined in: src/display/ViewerTheme.ts:24
Canvas clear alpha in [0, 1].
crosshair?
ts
optional crosshair?: CrossHairOptions;Defined in: src/display/ViewerTheme.ts:26
Crosshair styling (colour, alpha, halo, width, gap).
orientationLabels?
ts
optional orientationLabels?: OrientationLabelOptions;Defined in: src/display/ViewerTheme.ts:28
Orientation label styling (colour, alpha, stroke, shadow, font).