color

package
v1.0.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package color provides configuration for coloring for unified diffs using ANSI escape sequences.

Specifying colors uses Select Graphic Rendition parameters. For example the code below, presents the header in bold yellow:

HunkHeader(1, 33)

This is equivalent to the following raw ANSI sequence: \033[1;33m.

It's the responsibility of the caller to ensure that the parameters are correct and supported by the underlying terminal.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*config.ColorConfig)

A Option makes it possible to configure custom colors in [TerminalColors].

func Deletes

func Deletes(params ...int) Option

Deletes colors deleted lines.

func HunkHeaders

func HunkHeaders(params ...int) Option

HunkHeaders colors hunk headers, the "@@ ... @@" part of the unified diff.

func Inserts

func Inserts(params ...int) Option

Inserts colors deleted lines.

func Matches

func Matches(params ...int) Option

Matches colors matching lines.

Jump to

Keyboard shortcuts

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