2 curses library IO processing-color attribute

Source: Internet
Author: User

2.7 color attributes

==================


2.7.1 Color Description

---------------

* The curses library uses the RGB method to represent a color.

* The default colors are:

Color index number

--------------- + --------

COLOR_BLACK 0

COLOR_RED 1

COLOR_GREEN 2

COLOR_YELLOW 3

COLOR_BLUE 4

COLOR_MAGENTA 5

COLOR_CYAN 6

COLOR_WHITE 7


2.7.2 color functions and variables

---------------------

Int COLORS;/** maximum number of COLORS supported by the terminal */int COLORS_PAIRS;/** maximum number of color pairs supported by the terminal */chtype COLOR_PAIR (n ); /** return the color attribute of the initialized color pair table based on the index number * // ** @ brief restores the terminal color f to the status when the terminal is opened @ return ERR terminal does not support color @ return OK success @ note generally calls initscr () the function then calls this function, which initializes the color table, And I initializes the variables COLORS and COLOR_PAIRS */int start_color (); /** @ brief change the color definition in the color pairing table entry @ param color pairing index @ param foreground color @ param background color */int init_pair (short pair, short f, short B ); /** @ brief change color definition @ param color the color defined by the change @ param r red background weight @ param B blue background weight @ param g green background weight */int init_color (short color, short r, short B, short g );


This article is from the "dark day" blog, please be sure to keep this source http://darksun.blog.51cto.com/3874064/1286716

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.