define

fun define(specs: List<TagStyleSpec>, scope: (NodeType) -> Boolean? = null): HighlightStyle

Create a HighlightStyle from a list of tag→style specs.


inline fun define(noinline scope: (NodeType) -> Boolean? = null, block: HighlightStyleBuilder.() -> Unit): HighlightStyle

Define a HighlightStyle using a DSL builder.

val myStyle = HighlightStyle.define {
Tags.keyword styles SpanStyle(color = Color.Blue)
Tags.string styles SpanStyle(color = Color.Green)
listOf(Tags.number, Tags.bool) styles SpanStyle(color = Color.Cyan)
}