styles

package
v3.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: MIT, OFL-1.1 Imports: 6 Imported by: 8 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Fallback = func() *chroma.Style {
	fallback, ok := Lookup("swapoff")
	if !ok {
		panic(`chroma/styles: default fallback style "swapoff" is missing`)
	}
	return fallback
}()

Fallback style. Reassign to change the default fallback style.

Functions

func All

func All() []*chroma.Style

All returns every available style, sorted case-insensitively by name.

The first call parses every embedded style not yet looked up.

func Get

func Get(name string) *chroma.Style

Get named style, or Fallback.

func GetForMode

func GetForMode(name string, mode chroma.Mode) *chroma.Style

GetForMode returns the named style if it already matches mode, otherwise its registered counterpart if one exists and matches mode. If neither matches, the originally-requested style is returned (or Fallback if the name is unknown), so callers always get something usable.

func Lookup

func Lookup(name string) (*chroma.Style, bool)

Lookup a named style, returning false if not found. Embedded styles are parsed on first lookup.

func Names

func Names() []string

Names of all available styles.

func Register

func Register(style *chroma.Style) *chroma.Style

Register a chroma.Style.

func RegisterPair

func RegisterPair(a, b *chroma.Style)

RegisterPair links two styles as light/dark counterparts of each other.

Both styles are also registered if they are not already present.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL