[−][src]Function winconsole::console::read_output_colors
pub fn read_output_colors(
column: u16,
row: u16,
max_length: impl Into<Option<u32>>
) -> WinResult<Vec<(ConsoleColor, ConsoleColor)>>
Reads colors from the console output starting at a specified location, and returns a vector of tuples. The first item in each tuple is the foreground color, and the second is the background color.
Arguments
column
- The column at which reading should begin.row
- The row at which reading should begin.max_length
- The maximum amount of colors to read. If None, the entire output buffer is read.
Examples
Prints the colors in the first cell.
let colors = console::read_output_colors(0, 0, 1).unwrap(); println!("{} {}", colors[0].0, colors[0].1);
Errors
ArgumentError
: Returned ifcolumn
orrow
is not within the output buffer.InvalidHandleError
: Returned if an invalid handle to the console output is retrieved or used.IoError
: Returned if an OS error occurs.