color

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 0 Imported by: 0 modules, 0 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

Overview

Package color defines static 16-color ANSI escape sequences and diff action classifications.

Index

Constants

View Source
const (
	Reset     = "\x1b[0m"
	Bold      = "\x1b[1m"
	Dim       = "\x1b[2m"
	Italic    = "\x1b[3m"
	Underline = "\x1b[4m"
)

Terminal text formatting escape sequences.

View Source
const (
	InsertFg  = "\x1b[32m"
	DeleteFg  = "\x1b[31m"
	MoveFg    = "\x1b[36m"
	Move0Fg   = "\x1b[36m" // Slot 0: Cyan
	Move1Fg   = "\x1b[35m" // Slot 1: Magenta
	UpdateFg  = "\x1b[33m"
	HeaderFg  = "\x1b[1;94m" // Bold Bright Blue
	OverlayFg = "\x1b[90m"
	SurfaceFg = "\x1b[90m"
	TextFg    = "\x1b[39m"
)

Standard 16-color ANSI foreground escape sequences.

Variables

This section is empty.

Functions

func MoveFgForSlot added in v0.10.0

func MoveFgForSlot(slot int) string

MoveFgForSlot returns the ANSI foreground sequence for a given move color slot.

Types

type ActionKind

type ActionKind int

ActionKind represents the semantic category of an AST diff action or hunk line.

const (
	ActionNone ActionKind = iota - 1
	ActionDelete
	ActionInsert
	ActionUpdate
	ActionMove
	ActionMoveUpdate
	ActionMove1
)

func MoveActionKindForSlot added in v0.10.0

func MoveActionKindForSlot(slot int, isUpdate bool) ActionKind

MoveActionKindForSlot maps a slot index (0, 1) and update flag to an ActionKind.

func (ActionKind) String

func (k ActionKind) String() string

String returns the canonical name for an action kind.

Jump to

Keyboard shortcuts

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