Documentation
¶
Overview ¶
Package cell implements cell options and attributes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ColorTrueComponents ¶ added in v0.21.0
ColorTrueComponents decodes a ColorTrueRGB value into its r, g, b components. ok is false if c is not a true-color value.
func IsTrueColor ¶ added in v0.21.0
IsTrueColor reports whether c was created by ColorTrueRGB.
Types ¶
type Color ¶
type Color int
Color is the color of a cell.
const ( ColorDefault Color = iota // The 16 Xterm colors. // See https://jonasjacek.github.io/colors/ ColorBlack ColorMaroon ColorGreen ColorOlive ColorPurple ColorTeal ColorSilver ColorGray ColorRed ColorLime ColorYellow ColorBlue ColorFuchsia ColorAqua ColorWhite )
The supported terminal colors.
const ( ColorMagenta Color = ColorPurple ColorCyan Color = ColorTeal )
Colors defined for backward compatibility with termbox-go.
func ColorNumber ¶ added in v0.4.0
ColorNumber sets a color using its number. Make sure your terminal is set to a terminalapi.ColorMode that supports the target color. The provided value must be in the range 0-255. Larger or smaller values will be reset to the default color.
For reference on these colors see the Xterm number in: https://jonasjacek.github.io/colors/
func ColorRGB6 ¶ added in v0.4.0
ColorRGB6 sets a color using the 6x6x6 terminal color. Make sure your terminal is set to the terminalapi.ColorMode256 mode. The provided values (r, g, b) must be in the range 0-5. Larger or smaller values will be reset to the default color.
For reference on these colors see: https://superuser.com/questions/783656/whats-the-deal-with-terminal-colors
func ColorRGB24 ¶ added in v0.4.0
ColorRGB24 sets a color using the 24 bit web color scheme. Make sure your terminal is set to the terminalapi.ColorMode256 mode. The provided values (r, g, b) must be in the range 0-255. Larger or smaller values will be reset to the default color.
For reference on these colors see the RGB column in: https://jonasjacek.github.io/colors/
func ColorTrueRGB ¶ added in v0.21.0
ColorTrueRGB encodes a full 24-bit RGB color that is emitted as a true-color (ISO 8613-3 / "truecolor") escape sequence when the terminal backend supports it. The provided values (r, g, b) must be in the range 0–255; out-of-range values return ColorDefault.
Unlike ColorRGB24, which quantises to 216 colors, ColorTrueRGB preserves all 16 777 216 possible colors. It is detected automatically by the tcell backend and bypasses the ColorMode quantisation path.
type Option ¶
type Option interface {
// Set sets the provided option.
Set(*Options)
}
Option is used to provide options for cells on a 2-D terminal.
func Blink ¶ added in v0.13.0
func Blink() Option
Blink makes the cell's text blink. Only works when using the tcell backend.
func Dim ¶ added in v0.17.0
func Dim() Option
Dim makes the cell foreground color dim. Only works when using the tcell backend.
func Inverse ¶ added in v0.13.0
func Inverse() Option
Inverse inverts the colors of the cell's text.
func Italic ¶ added in v0.13.0
func Italic() Option
Italic makes cell's text italic. Only works when using the tcell backend.
func Strikethrough ¶ added in v0.13.0
func Strikethrough() Option
Strikethrough strikes through the cell's text. Only works when using the tcell backend.