SyntaxStyle
classin packageklyn.code.highlighters
public class SyntaxStyle extends Object
└ SyntaxStyle

UI-agnostic visual style attached to a syntax-highlighted token span.

Tracks foreground/background RGB components and text attributes (bold, underline, italic, inverse) independently from any specific rendering backend (terminal, GUI canvas, or HTML).

Example
import klyn.code.highlighters

style = SyntaxStyle(86, 156, 214, 0, 0, 0, true)
assert style.bold
Fields
Modifier and Type Member Description
public bgBlue
bgBlue as Int = 0
No summary.
public bgGreen
bgGreen as Int = 0
No summary.
public bgRed
bgRed as Int = 0
No summary.
public bold
bold as Boolean = false
No summary.
public fgBlue
fgBlue as Int = 235
No summary.
public fgGreen
fgGreen as Int = 225
No summary.
public fgRed
fgRed as Int = 215
No summary.
public inverse
inverse as Boolean = false
No summary.
public italic
italic as Boolean = false
No summary.
public underline
underline as Boolean = false
No summary.
Inherited Properties
propertyInherited Properties from Object: type
Constructors
Modifier and Type Member Description
public SyntaxStyle
SyntaxStyle( fgRed as Int = 215, fgGreen as Int = 225, fgBlue as Int = 235, bgRed as Int = 0, bgGreen as Int = 0, bgBlue as Int = 0, bold as Boolean = false, underline as Boolean = false, inverse as Boolean = false, italic as Boolean = false )
Builds a syntax style with explicit RGB colors and text attributes.
Methods
Modifier and Type Member Description
public assign
assign(other as SyntaxStyle) as Void
Copies all style attributes from other into this instance.
public static base
base() as SyntaxStyle
Returns the default base syntax style for plain text.
public copy
copy() as SyntaxStyle
Returns an independent copy of this style.
public sameAs
sameAs(other as SyntaxStyle) as Boolean
Returns true when both styles describe the exact same visual state.
public setBackground
setBackground(red as Int, green as Int, blue as Int) as Void
Updates the background RGB color components.
public setForeground
setForeground(red as Int, green as Int, blue as Int) as Void
Updates the foreground RGB color components.
public static terminalBase
terminalBase() as SyntaxStyle
Alias for SyntaxStyle.base() preserved for compatibility with terminal callers.
public toAnsi
toAnsi() as String
Serializes the style to a full 24-bit ANSI SGR escape sequence.
public override toString
toString() as String
Returns a human-readable diagnostic representation of this style.
Inherited Methods
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toMap, toString, toXml