Function pancurses::color_content

source ·
pub fn color_content(color_number: i16) -> (i16, i16, i16)
Expand description

This routine gives programmers a way to find the intensity of the red, green, and blue (RGB) components in a color. It takes the color number as an argument and returns three values that tell you the amounts of red, green, and blue components in the given color. The argument must be a legal color value, i.e., 0 through COLORS()-1, inclusive. The values that are returned are in the range 0 (no component) through 1000 (maximum amount of component), inclusive.

use pancurses::{can_change_color, color_content, endwin, init_color, initscr, start_color};

initscr();
start_color();
if can_change_color() {
    init_color(8, 35, 502, 1000);
    let (r, g, b) = color_content(8);
    assert_eq!(35, r);
    assert_eq!(502, g);
    assert_eq!(1000, b);
}
endwin();