terminal

package module
v0.0.0-...-b02a6d4 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2024 License: MIT Imports: 5 Imported by: 0

README

terminal

A go library for discovering information about the terminal emulator in which your program is running.

Currently, it only supports discovering how many colors are supported by the terminal.

There is an example binary you can run with go run cmd/termcolors/termcolors.go

Documentation

Overview

Package terminal helps developers determine various attributes of the current terminal emulator in which they are running.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Colors

type Colors struct {
	// contains filtered or unexported fields
}

Colors has methods for number of colors supported by the current terminal emulator.

func NewColors

func NewColors() *Colors

func (*Colors) Has16

func (t *Colors) Has16() bool

Has16 returns true if the terminal supports 4-bit color.

func (*Colors) Has256

func (t *Colors) Has256() bool

Has256 returns true if the terminal supports 8-bit color.

func (*Colors) HasMillions

func (t *Colors) HasMillions() bool

HasMillions is an alias for HasTrueColor.

func (*Colors) HasTrueColor

func (t *Colors) HasTrueColor() bool

HasTrueColor returns true if the terminal supports 24-bit color.

Directories

Path Synopsis
cmd
termcolors
termcolors - displays various grids of colors depending on the terminal emulator's color support.
termcolors - displays various grids of colors depending on the terminal emulator's color support.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳