Themed Highlight Result
data class ThemedHighlightResult(val light: AnnotatedString, val dark: AnnotatedString, val durationMs: Long, val timings: HighlightTimings)
Holds both light and dark AnnotatedString results from a single highlight call. Used by HighlightEngine.highlightBothThemes.
val result by rememberHighlightedCodeBothThemes(
code = code,
language = "kotlin",
lightTheme = rememberTomorrowTheme(),
darkTheme = rememberTomorrowNightTheme(),
)
val text = if (isDark) result?.dark else result?.light
Text(text = text ?: AnnotatedString(code))Content copied to clipboard
Constructors
Link copied to clipboard
constructor(light: AnnotatedString, dark: AnnotatedString, durationMs: Long, timings: HighlightTimings)
Properties
Link copied to clipboard
Syntax-highlighted AnnotatedString styled with the dark theme.
Link copied to clipboard
Pure highlight time in milliseconds - covers the JS call and a single HTML conversion pass (light and dark outputs are produced together in one pass). Excludes coroutine-scheduling overhead.
Link copied to clipboard
Syntax-highlighted AnnotatedString styled with the light theme.
Link copied to clipboard
Per-layer timing breakdown for this highlight call. Always populated. See HighlightTimings for the full stage breakdown.