output

package
v0.0.0-...-4164891 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

This file was referenced from https://github.com/sourcegraph/sourcegraph/blob/0aa8310ca4d924c084a7a3f836d7a4cbc45c3338/lib/output/style.go#L12

Index

Constants

View Source
const (
	EmojiFailure          = "❌"
	EmojiWarning          = "❗️"
	EmojiSuccess          = "✅"
	EmojiInfo             = "ℹ️"
	EmojiLightbulb        = "💡"
	EmojiAsterisk         = "✱"
	EmojiWarningSign      = "⚠️"
	EmojiFingerPointRight = "👉"
	EmojiHourglass        = "⌛"
	EmojiShrug            = "🤷"
	EmojiOk               = "👌"
	EmojiQuestionMark     = "❔"
)

Standard emoji for use in output.

Variables

View Source
var (

	// StyleReset is a style that resets all styles.
	// It should be used at the end of every styled string.
	StyleReset = &style{"\033[0m"}

	StylePending = Fg256Color(4)
	// StyleInfo is a style that is used for informational messages.
	StyleInfo       = StylePending
	StyleWarning    = Fg256Color(124)
	StyleFailure    = CombineStyles(StyleBold, Fg256Color(196))
	StyleSuccess    = Fg256Color(2)
	StyleSuggestion = Fg256Color(244)

	StyleBold      = &style{"\033[1m"}
	StyleItalic    = &style{"\033[3m"}
	StyleUnderline = &style{"\033[4m"}

	StyleWhiteOnPurple  = CombineStyles(Fg256Color(255), Bg256Color(55))
	StyleGreyBackground = CombineStyles(Fg256Color(0), Bg256Color(242))

	StyleLinesDeleted = Fg256Color(196)
	StyleLinesAdded   = Fg256Color(2)

	// Colors
	StyleGrey   = Fg256Color(7)
	StyleYellow = Fg256Color(220)
	StyleOrange = Fg256Color(202)
)

Functions

This section is empty.

Types

type Style

type Style interface {
	fmt.Stringer
}

func Bg256Color

func Bg256Color(code int) Style

Bg256Color returns a style that sets the background color to the given 256-color code.

func CombineStyles

func CombineStyles(styles ...Style) Style

CombineStyles combines multiple styles into a single style.

func Fg256Color

func Fg256Color(code int) Style

Fg256Color returns a style that sets the foreground color to the given 256-color code.

Jump to

Keyboard shortcuts

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