package core:encoding/ansi
Overview
package ansi implements constant references to many widely-supported ANSI escape codes, primarily used in terminal emulators for enhanced graphics, such as colors, text styling, and animated displays.
For example, you can print out a line of cyan text like this:
fmt.println(ansi.CSI + ansi.FG_CYAN + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR)
Multiple SGR (Select Graphic Rendition) codes can be joined by semicolons:
fmt.println(ansi.CSI + ansi.BOLD + ";" + ansi.FG_BLUE + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR)
If your terminal supports 24-bit true color mode, you can also do this:
fmt.println(ansi.CSI + ansi.FG_COLOR_24_BIT + ";0;255;255" + ansi.SGR + "Hellope!" + ansi.CSI + ansi.RESET + ansi.SGR)
For more information, see: https://en.wikipedia.org/wiki/ANSI_escape_code https://www.vt100.net/docs/vt102-ug/chapter5.html https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
Index
Types (0)
This section is empty.
Constants (110)
- AUX_OFF
- AUX_ON
- BEL
- BG_BLACK
- BG_BLUE
- BG_BRIGHT_BLACK
- BG_BRIGHT_BLUE
- BG_BRIGHT_CYAN
- BG_BRIGHT_GREEN
- BG_BRIGHT_MAGENTA
- BG_BRIGHT_RED
- BG_BRIGHT_WHITE
- BG_BRIGHT_YELLOW
- BG_COLOR
- BG_COLOR_24_BIT
- BG_COLOR_8_BIT
- BG_CYAN
- BG_DEFAULT
- BG_GREEN
- BG_MAGENTA
- BG_RED
- BG_WHITE
- BG_YELLOW
- BLINK_RAPID
- BLINK_SLOW
- BOLD
- BS
- CHA
- CLIPBOARD
- CNL
- CPL
- CSI
- CUB
- CUD
- CUF
- CUP
- CUU
- DECAWM_OFF
- DECAWM_ON
- DECRC
- DECSC
- DECTCEM_HIDE
- DECTCEM_SHOW
- DSR
- ED
- EL
- ENCIRCLED
- ESC
- FAINT
- FG_BLACK
- FG_BLUE
- FG_BRIGHT_BLACK
- FG_BRIGHT_BLUE
- FG_BRIGHT_CYAN
- FG_BRIGHT_GREEN
- FG_BRIGHT_MAGENTA
- FG_BRIGHT_RED
- FG_BRIGHT_WHITE
- FG_BRIGHT_YELLOW
- FG_COLOR
- FG_COLOR_24_BIT
- FG_COLOR_8_BIT
- FG_CYAN
- FG_DEFAULT
- FG_GREEN
- FG_MAGENTA
- FG_RED
- FG_WHITE
- FG_YELLOW
- FONT_ALT1
- FONT_ALT2
- FONT_ALT3
- FONT_ALT4
- FONT_ALT5
- FONT_ALT6
- FONT_ALT7
- FONT_ALT8
- FONT_ALT9
- FONT_FRAKTUR
- FONT_PRIMARY
- FRAMED
- HIDE
- HVP
- HYPERLINK
- INVERT
- ITALIC
- NO_BLINK
- NO_BOLD_FAINT
- NO_FRAME_ENCIRCLE
- NO_HIDE
- NO_ITALIC_BLACKLETTER
- NO_OVERLINE
- NO_PROPORTIONAL_SPACING
- NO_REVERSE
- NO_STRIKE
- NO_UNDERLINE
- OSC
- OVERLINED
- PROPORTIONAL_SPACING
- RCP
- RESET
- SCP
- SD
- SGR
- ST
- STRIKE
- SU
- UNDERLINE
- UNDERLINE_DOUBLE
- WINDOW_TITLE
Variables (0)
This section is empty.
Procedures (0)
This section is empty.
Procedure Groups (0)
This section is empty.
Types
This section is empty.
Constants
BG_BLACK ¶
BG_BLACK: string : "40"
BG_BRIGHT_BLUE ¶
BG_BRIGHT_BLUE: string : "104"
BG_BRIGHT_CYAN ¶
BG_BRIGHT_CYAN: string : "106"
BG_BRIGHT_GREEN ¶
BG_BRIGHT_GREEN: string : "102"
BG_BRIGHT_MAGENTA ¶
BG_BRIGHT_MAGENTA: string : "105"
BG_BRIGHT_RED ¶
BG_BRIGHT_RED: string : "101"
BG_BRIGHT_WHITE ¶
BG_BRIGHT_WHITE: string : "107"
BG_BRIGHT_YELLOW ¶
BG_BRIGHT_YELLOW: string : "103"
BG_COLOR ¶
BG_COLOR: string : "48"
BG_DEFAULT ¶
BG_DEFAULT: string : "49"
BG_GREEN ¶
BG_GREEN: string : "42"
BG_MAGENTA ¶
BG_MAGENTA: string : "45"
BG_WHITE ¶
BG_WHITE: string : "47"
BG_YELLOW ¶
BG_YELLOW: string : "43"
BLINK_SLOW ¶
BLINK_SLOW: string : "5"
ENCIRCLED ¶
ENCIRCLED: string : "52"
FG_BLACK ¶
FG_BLACK: string : "30"
FG_BRIGHT_BLUE ¶
FG_BRIGHT_BLUE: string : "94"
FG_BRIGHT_CYAN ¶
FG_BRIGHT_CYAN: string : "96"
FG_BRIGHT_GREEN ¶
FG_BRIGHT_GREEN: string : "92"
FG_BRIGHT_MAGENTA ¶
FG_BRIGHT_MAGENTA: string : "95"
FG_BRIGHT_RED ¶
FG_BRIGHT_RED: string : "91"
FG_BRIGHT_WHITE ¶
FG_BRIGHT_WHITE: string : "97"
FG_BRIGHT_YELLOW ¶
FG_BRIGHT_YELLOW: string : "93"
FG_COLOR ¶
FG_COLOR: string : "38"
FG_DEFAULT ¶
FG_DEFAULT: string : "39"
FG_GREEN ¶
FG_GREEN: string : "32"
FG_MAGENTA ¶
FG_MAGENTA: string : "35"
FG_WHITE ¶
FG_WHITE: string : "37"
FG_YELLOW ¶
FG_YELLOW: string : "33"
FONT_ALT1 ¶
FONT_ALT1: string : "11"
FONT_ALT2 ¶
FONT_ALT2: string : "12"
FONT_ALT3 ¶
FONT_ALT3: string : "13"
FONT_ALT4 ¶
FONT_ALT4: string : "14"
FONT_ALT5 ¶
FONT_ALT5: string : "15"
FONT_ALT6 ¶
FONT_ALT6: string : "16"
FONT_ALT7 ¶
FONT_ALT7: string : "17"
FONT_ALT8 ¶
FONT_ALT8: string : "18"
FONT_ALT9 ¶
FONT_ALT9: string : "19"
FONT_PRIMARY ¶
FONT_PRIMARY: string : "10"
HYPERLINK ¶
HYPERLINK: string : "8"
Followed by ";[params];<URI>" ST. Closed by OSC HYPERLINK ";;" ST.
NO_BLINK ¶
NO_BLINK: string : "25"
NO_BOLD_FAINT ¶
NO_BOLD_FAINT: string : "22"
NO_FRAME_ENCIRCLE ¶
NO_FRAME_ENCIRCLE: string : "54"
NO_ITALIC_BLACKLETTER ¶
NO_ITALIC_BLACKLETTER: string : "23"
NO_OVERLINE ¶
NO_OVERLINE: string : "55"
NO_PROPORTIONAL_SPACING ¶
NO_PROPORTIONAL_SPACING: string : "50"
NO_REVERSE ¶
NO_REVERSE: string : "27"
NO_STRIKE ¶
NO_STRIKE: string : "29"
NO_UNDERLINE ¶
NO_UNDERLINE: string : "24"
OVERLINED ¶
OVERLINED: string : "53"
PROPORTIONAL_SPACING ¶
PROPORTIONAL_SPACING: string : "26"
UNDERLINE ¶
UNDERLINE: string : "4"
Variables
This section is empty.
Procedures
This section is empty.
Procedure Groups
This section is empty.
Source Files
Generation Information
Generated with odin version dev-2025-03 (vendor "odin") Windows_amd64 @ 2025-03-25 21:11:15.173309900 +0000 UTC