[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

has_colors Subroutine

Purpose

Determines whether a terminal supports color.

Library

Curses Library (libcurses.a)

Syntax

#include <curses.h>
has_colors() 

Description

The has_colors subroutine determines whether a terminal supports color. If the terminal supports color, the has_colors subroutine returns TRUE. Otherwise, it returns FALSE. Because this subroutine tests for color, you can call it before the start_color subroutine.

The has_colors routine makes writing terminal-independent programs easier because you can use the subroutine to determine whether to use color or another video attribute.

Use the can_change_colors subroutine to determine whether a terminal that supports colors also supports changing its color definitions.

Examples

To determine whether or not a terminal supports color, use:

has_colors();

Implementation Specifics

This routine is part of Base Operating System (BOS) Runtime.

Related Information

Curses Overview for Programming in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

List of Curses Subroutines in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

Manipulating Video Attributes in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Contents | Glossary | Home | Search ]