Пример #1
0
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
/*
====================================================
Color Setup Functions
====================================================
*/
func StartColor() error {
	if C.has_colors() == 0 {
		return ErrorTerminalColor
	}
	C.start_color()

	return nil
}
Пример #3
0
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
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
/* 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
}