Skip to content

Commit

Permalink
Merge pull request #40 from rgburke/color
Browse files Browse the repository at this point in the history
Expose COLORS and COLOR_PAIRS variables
  • Loading branch information
rthornton128 committed May 7, 2018
2 parents 7c3fe1c + 9a788ac commit 52220cf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions ncurses.go
Expand Up @@ -51,6 +51,11 @@ func CanChangeColor() bool {
return bool(C.bool(C.can_change_color()))
}

// Colors returns the number of colors that the terminal supports
func Colors() int {
return int(C.COLORS)
}

// Get RGB values for specified colour
func ColorContent(col int16) (int16, int16, int16) {
var r, g, b C.short
Expand All @@ -65,6 +70,11 @@ func ColorPair(pair int16) Char {
return Char(C.ncurses_COLOR_PAIR(C.int(pair)))
}

// ColorPairs returns the maximum number of color pairs that the terminal supports
func ColorPairs() int {
return int(C.COLOR_PAIRS)
}

// CursesVersion returns the version of the ncurses library currently linked to
func CursesVersion() string {
return C.GoString(C.curses_version())
Expand Down

0 comments on commit 52220cf

Please sign in to comment.