Docs · API reference · Verso.Abstractions

SyntaxColorMap Class#

Mutable mapping from syntax token type names to their display colors, expressed as hex strings.

public sealed class SyntaxColorMap

Inheritance System.Object → SyntaxColorMap

Properties#

Count Property#

Gets the number of token type mappings in this color map.

public int Count { get; }

Property Value#

System.Int32

Methods#

Get(string) Method#

Gets the hex color for a given syntax token type, or null if not mapped.

public string? Get(string tokenType);

Parameters#

tokenType System.String

The syntax token type name to look up.

Returns#

System.String
The hex color string, or null if the token type has no mapping.

GetAll() Method#

Returns a read-only view of all token-type-to-color mappings.

public System.Collections.Generic.IReadOnlyDictionary<string,string> GetAll();

Returns#

System.Collections.Generic.IReadOnlyDictionary<System.String,System.String>
A read-only dictionary of token type names to hex color strings.

Set(string, string) Method#

Sets or overwrites the hex color for a given syntax token type.

public void Set(string tokenType, string hexColor);

Parameters#

tokenType System.String

The syntax token type name (e.g. "keyword", "comment").

hexColor System.String

The hex color string to associate with the token type (e.g. "#FF5733").