[−][src]Function winconsole::console::write_output_colors
pub fn write_output_colors(
colors: &[(ConsoleColor, ConsoleColor)],
column: u16,
row: u16
) -> WinResult<u32>
Changes the output colors starting at a specified position, and returns the number of cells which were written to.
Arguments
colors
- The colors to write to the console. The first item in each tuple is the foreground color, and the second is the background color.column
- The column at which writing will begin.row
- The row at which writing will begin.
Examples
Writes colors to the console starting at <0, 0>.
let colors = vec![ (ConsoleColor::Red, ConsoleColor::Blue), (ConsoleColor::Blue, ConsoleColor::Red), (ConsoleColor::Red, ConsoleColor::Blue), (ConsoleColor::Blue, ConsoleColor::Red) ]; console::write_output_colors(&colors, 0, 0).unwrap();
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.