예제 #1
0
파일: curses.go 프로젝트: AaronO/lightwave
func Start_color() os.Error {
	if int(C.has_colors()) == 0 {
		return CursesError{"terminal does not support color"}
	}
	C.start_color()

	return nil
}
예제 #2
0
파일: curses.go 프로젝트: zozor/gocurse
/*
====================================================
Color Setup Functions
====================================================
*/
func StartColor() error {
	if C.has_colors() == 0 {
		return ErrorTerminalColor
	}
	C.start_color()

	return nil
}
예제 #3
0
파일: curses.go 프로젝트: zyxar/gocurse
func StartColor() error {
	if C.has_colors() == C.ERR {
		return CursesError{"terminal does not support color"}
	}
	C.start_color()

	return nil
}
예제 #4
0
// Enables colors to be displayed. Will return an error if terminal is not
// capable of displaying colors
func StartColor() error {
	if C.has_colors() == C.bool(false) {
		return errors.New("Terminal does not support colors")
	}
	if C.start_color() == C.ERR {
		return errors.New("Failed to enable color mode")
	}
	return nil
}
예제 #5
0
파일: curses.go 프로젝트: jncorpron/gocurse
func HasColors() bool {
	return isOk(C.has_colors())
}
예제 #6
0
// HasColors returns true if terminal can display colors
func HasColors() bool {
	return bool(C.has_colors())
}
예제 #7
0
파일: ncurses.go 프로젝트: Olreich/ncurses
/* Checks whether the current terminal supports colors, and returns true if it does. */
func HasColors() bool {
	if C.has_colors() > 0 {
		return true
	}
	return false
}