Versions in this module Expand all Collapse all v2 v2.7.0 Jan 28, 2024 Changes in this version + const Color100 + const Color101 + const Color102 + const Color103 + const Color104 + const Color105 + const Color106 + const Color107 + const Color108 + const Color109 + const Color110 + const Color111 + const Color112 + const Color113 + const Color114 + const Color115 + const Color116 + const Color117 + const Color118 + const Color119 + const Color120 + const Color121 + const Color122 + const Color123 + const Color124 + const Color125 + const Color126 + const Color127 + const Color128 + const Color129 + const Color130 + const Color131 + const Color132 + const Color133 + const Color134 + const Color135 + const Color136 + const Color137 + const Color138 + const Color139 + const Color140 + const Color141 + const Color142 + const Color143 + const Color144 + const Color145 + const Color146 + const Color147 + const Color148 + const Color149 + const Color150 + const Color151 + const Color152 + const Color153 + const Color154 + const Color155 + const Color156 + const Color157 + const Color158 + const Color159 + const Color16 + const Color160 + const Color161 + const Color162 + const Color163 + const Color164 + const Color165 + const Color166 + const Color167 + const Color168 + const Color169 + const Color17 + const Color170 + const Color171 + const Color172 + const Color173 + const Color174 + const Color175 + const Color176 + const Color177 + const Color178 + const Color179 + const Color18 + const Color180 + const Color181 + const Color182 + const Color183 + const Color184 + const Color185 + const Color186 + const Color187 + const Color188 + const Color189 + const Color19 + const Color190 + const Color191 + const Color192 + const Color193 + const Color194 + const Color195 + const Color196 + const Color197 + const Color198 + const Color199 + const Color20 + const Color200 + const Color201 + const Color202 + const Color203 + const Color204 + const Color205 + const Color206 + const Color207 + const Color208 + const Color209 + const Color21 + const Color210 + const Color211 + const Color212 + const Color213 + const Color214 + const Color215 + const Color216 + const Color217 + const Color218 + const Color219 + const Color22 + const Color220 + const Color221 + const Color222 + const Color223 + const Color224 + const Color225 + const Color226 + const Color227 + const Color228 + const Color229 + const Color23 + const Color230 + const Color231 + const Color232 + const Color233 + const Color234 + const Color235 + const Color236 + const Color237 + const Color238 + const Color239 + const Color24 + const Color240 + const Color241 + const Color242 + const Color243 + const Color244 + const Color245 + const Color246 + const Color247 + const Color248 + const Color249 + const Color25 + const Color250 + const Color251 + const Color252 + const Color253 + const Color254 + const Color255 + const Color26 + const Color27 + const Color28 + const Color29 + const Color30 + const Color31 + const Color32 + const Color33 + const Color34 + const Color35 + const Color36 + const Color37 + const Color38 + const Color39 + const Color40 + const Color41 + const Color42 + const Color43 + const Color44 + const Color45 + const Color46 + const Color47 + const Color48 + const Color49 + const Color50 + const Color51 + const Color52 + const Color53 + const Color54 + const Color55 + const Color56 + const Color57 + const Color58 + const Color59 + const Color60 + const Color61 + const Color62 + const Color63 + const Color64 + const Color65 + const Color66 + const Color67 + const Color68 + const Color69 + const Color70 + const Color71 + const Color72 + const Color73 + const Color74 + const Color75 + const Color76 + const Color77 + const Color78 + const Color79 + const Color80 + const Color81 + const Color82 + const Color83 + const Color84 + const Color85 + const Color86 + const Color87 + const Color88 + const Color89 + const Color90 + const Color91 + const Color92 + const Color93 + const Color94 + const Color95 + const Color96 + const Color97 + const Color98 + const Color99 + const ColorAliceBlue + const ColorAntiqueWhite + const ColorAqua + const ColorAquaMarine + const ColorAzure + const ColorBeige + const ColorBisque + const ColorBlack + const ColorBlanchedAlmond + const ColorBlue + const ColorBlueViolet + const ColorBrown + const ColorBurlyWood + const ColorCadetBlue + const ColorChartreuse + const ColorChocolate + const ColorCoral + const ColorCornflowerBlue + const ColorCornsilk + const ColorCrimson + const ColorDarkBlue + const ColorDarkCyan + const ColorDarkGoldenrod + const ColorDarkGray + const ColorDarkGreen + const ColorDarkGrey + const ColorDarkKhaki + const ColorDarkMagenta + const ColorDarkOliveGreen + const ColorDarkOrange + const ColorDarkOrchid + const ColorDarkRed + const ColorDarkSalmon + const ColorDarkSeaGreen + const ColorDarkSlateBlue + const ColorDarkSlateGray + const ColorDarkSlateGrey + const ColorDarkTurquoise + const ColorDarkViolet + const ColorDeepPink + const ColorDeepSkyBlue + const ColorDimGray + const ColorDimGrey + const ColorDodgerBlue + const ColorFireBrick + const ColorFloralWhite + const ColorForestGreen + const ColorFuchsia + const ColorGainsboro + const ColorGhostWhite + const ColorGold + const ColorGoldenrod + const ColorGray + const ColorGreen + const ColorGreenYellow + const ColorGrey + const ColorHoneydew + const ColorHotPink + const ColorIndianRed + const ColorIndigo + const ColorIvory + const ColorKhaki + const ColorLavender + const ColorLavenderBlush + const ColorLawnGreen + const ColorLemonChiffon + const ColorLightBlue + const ColorLightCoral + const ColorLightCyan + const ColorLightGoldenrodYellow + const ColorLightGray + const ColorLightGreen + const ColorLightGrey + const ColorLightPink + const ColorLightSalmon + const ColorLightSeaGreen + const ColorLightSkyBlue + const ColorLightSlateGray + const ColorLightSlateGrey + const ColorLightSteelBlue + const ColorLightYellow + const ColorLime + const ColorLimeGreen + const ColorLinen + const ColorMaroon + const ColorMediumAquamarine + const ColorMediumBlue + const ColorMediumOrchid + const ColorMediumPurple + const ColorMediumSeaGreen + const ColorMediumSlateBlue + const ColorMediumSpringGreen + const ColorMediumTurquoise + const ColorMediumVioletRed + const ColorMidnightBlue + const ColorMintCream + const ColorMistyRose + const ColorMoccasin + const ColorNavajoWhite + const ColorNavy + const ColorNone + const ColorOldLace + const ColorOlive + const ColorOliveDrab + const ColorOrange + const ColorOrangeRed + const ColorOrchid + const ColorPaleGoldenrod + const ColorPaleGreen + const ColorPaleTurquoise + const ColorPaleVioletRed + const ColorPapayaWhip + const ColorPeachPuff + const ColorPeru + const ColorPink + const ColorPlum + const ColorPowderBlue + const ColorPurple + const ColorRebeccaPurple + const ColorRed + const ColorReset + const ColorRosyBrown + const ColorRoyalBlue + const ColorSaddleBrown + const ColorSalmon + const ColorSandyBrown + const ColorSeaGreen + const ColorSeashell + const ColorSienna + const ColorSilver + const ColorSkyblue + const ColorSlateBlue + const ColorSlateGray + const ColorSlateGrey + const ColorSnow + const ColorSpringGreen + const ColorSteelBlue + const ColorTan + const ColorTeal + const ColorThistle + const ColorTomato + const ColorTurquoise + const ColorViolet + const ColorWheat + const ColorWhite + const ColorWhiteSmoke + const ColorYellow + const ColorYellowGreen + const CursorStyleBlinkingBar + const CursorStyleBlinkingBlock + const CursorStyleBlinkingUnderline + const CursorStyleDefault + const CursorStyleSteadyBar + const CursorStyleSteadyBlock + const CursorStyleSteadyUnderline + const EncodingFallbackASCII + const EncodingFallbackFail + const EncodingFallbackUTF8 + const KeyBackspace + const KeyBackspace2 + const KeyEnter + const KeyEsc + const KeyEscape + const KeyTab + const MouseButtonEvents + const MouseDragEvents + const MouseMotionEvents + const RuneBTee + const RuneBlock + const RuneBoard + const RuneBullet + const RuneCkBoard + const RuneDArrow + const RuneDegree + const RuneDiamond + const RuneGEqual + const RuneHLine + const RuneLArrow + const RuneLEqual + const RuneLLCorner + const RuneLRCorner + const RuneLTee + const RuneLantern + const RuneNEqual + const RunePi + const RunePlMinus + const RunePlus + const RuneRArrow + const RuneRTee + const RuneS1 + const RuneS3 + const RuneS7 + const RuneS9 + const RuneSterling + const RuneTTee + const RuneUArrow + const RuneULCorner + const RuneURCorner + const RuneVLine + var ColorNames = map[string]Color + var ColorValues = map[Color]int32 + var ErrEventQFull = errors.New("event queue full") + var ErrNoCharset = errors.New("character set not supported") + var ErrNoScreen = errors.New("no suitable screen available") + var ErrTermNotFound = terminfo.ErrTermNotFound + var KeyNames = map[Key]string + var RuneFallbacks = map[rune]string + var WebKeyNames = map[string]Key — js/wasm + func GetEncoding(charset string) encoding.Encoding + func LookupTerminfo(name string) (ti *terminfo.Terminfo, e error) + func RegisterEncoding(charset string, enc encoding.Encoding) + func SetEncodingFallback(fb EncodingFallback) + type AttrMask int + const AttrBlink + const AttrBold + const AttrDim + const AttrInvalid + const AttrItalic + const AttrNone + const AttrReverse + const AttrStrikeThrough + const AttrUnderline + type ButtonMask int16 + const Button1 + const Button2 + const Button3 + const Button4 + const Button5 + const Button6 + const Button7 + const Button8 + const ButtonMiddle + const ButtonNone + const ButtonPrimary + const ButtonSecondary + const WheelDown + const WheelLeft + const WheelRight + const WheelUp + type CellBuffer struct + func (cb *CellBuffer) Dirty(x, y int) bool + func (cb *CellBuffer) Fill(r rune, style Style) + func (cb *CellBuffer) GetContent(x, y int) (rune, []rune, Style, int) + func (cb *CellBuffer) Invalidate() + func (cb *CellBuffer) LockCell(x, y int) + func (cb *CellBuffer) Resize(w, h int) + func (cb *CellBuffer) SetContent(x int, y int, mainc rune, combc []rune, style Style) + func (cb *CellBuffer) SetDirty(x, y int, dirty bool) + func (cb *CellBuffer) Size() (int, int) + func (cb *CellBuffer) UnlockCell(x, y int) + type Color uint64 + const ColorDefault + const ColorIsRGB + const ColorSpecial + const ColorValid + func FindColor(c Color, palette []Color) Color + func FromImageColor(imageColor ic.Color) Color + func GetColor(name string) Color + func NewHexColor(v int32) Color + func NewRGBColor(r, g, b int32) Color + func PaletteColor(index int) Color + func (c Color) CSS() string + func (c Color) Hex() int32 + func (c Color) IsRGB() bool + func (c Color) Name(css ...bool) string + func (c Color) RGB() (int32, int32, int32) + func (c Color) String() string + func (c Color) TrueColor() Color + func (c Color) Valid() bool + type CursorStyle int + type EncodingFallback int + type Event interface + When func() time.Time + type EventError struct + func NewEventError(err error) *EventError + func (ev *EventError) Error() string + func (ev *EventError) When() time.Time + type EventFocus struct + Focused bool + func NewEventFocus(focused bool) *EventFocus + type EventHandler interface + HandleEvent func(Event) bool + type EventInterrupt struct + func NewEventInterrupt(data interface{}) *EventInterrupt + func (ev *EventInterrupt) Data() interface{} + func (ev *EventInterrupt) When() time.Time + type EventKey struct + func NewEventKey(k Key, ch rune, mod ModMask) *EventKey + func (ev *EventKey) Key() Key + func (ev *EventKey) Modifiers() ModMask + func (ev *EventKey) Name() string + func (ev *EventKey) Rune() rune + func (ev *EventKey) When() time.Time + type EventMouse struct + func NewEventMouse(x, y int, btn ButtonMask, mod ModMask, motion bool) *EventMouse + func (ev *EventMouse) Buttons() ButtonMask + func (ev *EventMouse) HasMotion() bool + func (ev *EventMouse) Modifiers() ModMask + func (ev *EventMouse) Position() (int, int) + func (ev *EventMouse) When() time.Time + type EventPaste struct + func NewEventPaste(start bool) *EventPaste + func (ev *EventPaste) End() bool + func (ev *EventPaste) Start() bool + func (ev *EventPaste) When() time.Time + type EventResize struct + func NewEventResize(width, height int) *EventResize + func (ev *EventResize) PixelSize() (int, int) + func (ev *EventResize) Size() (int, int) + func (ev *EventResize) When() time.Time + type EventTime struct + func (e *EventTime) SetEventNow() + func (e *EventTime) SetEventTime(t time.Time) + func (e *EventTime) When() time.Time + type Key int16 + const KeyACK + const KeyBEL + const KeyBS + const KeyBacktab + const KeyCAN + const KeyCR + const KeyCancel + const KeyCenter + const KeyClear + const KeyCtrlA + const KeyCtrlB + const KeyCtrlBackslash + const KeyCtrlC + const KeyCtrlCarat + const KeyCtrlD + const KeyCtrlE + const KeyCtrlF + const KeyCtrlG + const KeyCtrlH + const KeyCtrlI + const KeyCtrlJ + const KeyCtrlK + const KeyCtrlL + const KeyCtrlLeftSq + const KeyCtrlM + const KeyCtrlN + const KeyCtrlO + const KeyCtrlP + const KeyCtrlQ + const KeyCtrlR + const KeyCtrlRightSq + const KeyCtrlS + const KeyCtrlSpace + const KeyCtrlT + const KeyCtrlU + const KeyCtrlUnderscore + const KeyCtrlV + const KeyCtrlW + const KeyCtrlX + const KeyCtrlY + const KeyCtrlZ + const KeyDC1 + const KeyDC2 + const KeyDC3 + const KeyDC4 + const KeyDEL + const KeyDLE + const KeyDelete + const KeyDown + const KeyDownLeft + const KeyDownRight + const KeyEM + const KeyENQ + const KeyEOT + const KeyESC + const KeyETB + const KeyETX + const KeyEnd + const KeyExit + const KeyF1 + const KeyF10 + const KeyF11 + const KeyF12 + const KeyF13 + const KeyF14 + const KeyF15 + const KeyF16 + const KeyF17 + const KeyF18 + const KeyF19 + const KeyF2 + const KeyF20 + const KeyF21 + const KeyF22 + const KeyF23 + const KeyF24 + const KeyF25 + const KeyF26 + const KeyF27 + const KeyF28 + const KeyF29 + const KeyF3 + const KeyF30 + const KeyF31 + const KeyF32 + const KeyF33 + const KeyF34 + const KeyF35 + const KeyF36 + const KeyF37 + const KeyF38 + const KeyF39 + const KeyF4 + const KeyF40 + const KeyF41 + const KeyF42 + const KeyF43 + const KeyF44 + const KeyF45 + const KeyF46 + const KeyF47 + const KeyF48 + const KeyF49 + const KeyF5 + const KeyF50 + const KeyF51 + const KeyF52 + const KeyF53 + const KeyF54 + const KeyF55 + const KeyF56 + const KeyF57 + const KeyF58 + const KeyF59 + const KeyF6 + const KeyF60 + const KeyF61 + const KeyF62 + const KeyF63 + const KeyF64 + const KeyF7 + const KeyF8 + const KeyF9 + const KeyFF + const KeyFS + const KeyGS + const KeyHelp + const KeyHome + const KeyInsert + const KeyLF + const KeyLeft + const KeyNAK + const KeyNUL + const KeyPause + const KeyPgDn + const KeyPgUp + const KeyPrint + const KeyRS + const KeyRight + const KeyRune + const KeySI + const KeySO + const KeySOH + const KeySTX + const KeySUB + const KeySYN + const KeyTAB + const KeyUS + const KeyUp + const KeyUpLeft + const KeyUpRight + const KeyVT + type ModMask int16 + const ModAlt + const ModCtrl + const ModMeta + const ModNone + const ModShift + type MouseFlags int + type Screen interface + Beep func() error + CanDisplay func(r rune, checkFallbacks bool) bool + ChannelEvents func(ch chan<- Event, quit <-chan struct{}) + CharacterSet func() string + Clear func() + Colors func() int + DisableFocus func() + DisableMouse func() + DisablePaste func() + EnableFocus func() + EnableMouse func(...MouseFlags) + EnablePaste func() + Fill func(rune, Style) + Fini func() + GetContent func(x, y int) (primary rune, combining []rune, style Style, width int) + HasKey func(Key) bool + HasMouse func() bool + HasPendingEvent func() bool + HideCursor func() + Init func() error + LockRegion func(x, y, width, height int, lock bool) + PollEvent func() Event + PostEvent func(ev Event) error + PostEventWait func(ev Event) + RegisterRuneFallback func(r rune, subst string) + Resize func(int, int, int, int) + Resume func() error + SetCell func(x int, y int, style Style, ch ...rune) + SetContent func(x int, y int, primary rune, combining []rune, style Style) + SetCursorStyle func(CursorStyle) + SetSize func(int, int) + SetStyle func(style Style) + Show func() + ShowCursor func(x int, y int) + Size func() (width, height int) + Suspend func() error + Sync func() + Tty func() (Tty, bool) + UnregisterRuneFallback func(r rune) + func NewConsoleScreen() (Screen, error) + func NewScreen() (Screen, error) + func NewTerminfoScreen() (Screen, error) + func NewTerminfoScreenFromTty(tty Tty) (Screen, error) + func NewTerminfoScreenFromTtyTerminfo(tty Tty, ti *terminfo.Terminfo) (s Screen, e error) + type SimCell struct + Bytes []byte + Runes []rune + Style Style + type SimulationScreen interface + GetContents func() (cells []SimCell, width int, height int) + GetCursor func() (x int, y int, visible bool) + InjectKey func(key Key, r rune, mod ModMask) + InjectKeyBytes func(buf []byte) bool + InjectMouse func(x, y int, buttons ButtonMask, mod ModMask) + func NewSimulationScreen(charset string) SimulationScreen + type Style struct + var StyleDefault Style + func (s Style) Attributes(attrs AttrMask) Style + func (s Style) Background(c Color) Style + func (s Style) Blink(on bool) Style + func (s Style) Bold(on bool) Style + func (s Style) Decompose() (fg Color, bg Color, attr AttrMask) + func (s Style) Dim(on bool) Style + func (s Style) Foreground(c Color) Style + func (s Style) Italic(on bool) Style + func (s Style) Normal() Style + func (s Style) Reverse(on bool) Style + func (s Style) StrikeThrough(on bool) Style + func (s Style) Underline(on bool) Style + func (s Style) Url(url string) Style + func (s Style) UrlId(id string) Style + type Tty interface + Drain func() error + NotifyResize func(cb func()) + Start func() error + Stop func() error + WindowSize func() (WindowSize, error) + func NewDevTty() (Tty, error) + func NewDevTtyFromDev(dev string) (Tty, error) + func NewStdIoTty() (Tty, error) + type WindowSize struct + Height int + PixelHeight int + PixelWidth int + Width int + func (ws WindowSize) CellDimensions() (int, int)