Update readme, fix rainbow example

This commit is contained in:
ticki 2016-07-23 17:32:08 +02:00
parent e36ff1c71b
commit b17d0151d9
2 changed files with 4 additions and 3 deletions

View File

@ -37,7 +37,7 @@ default-features = false
## Features
- Raw mode.
- Truecolor.
- TrueColor.
- 256-color mode.
- Cursor movement.
- Color output.
@ -48,6 +48,7 @@ default-features = false
- Termios control.
- Password input.
- Redox support.
- Safe `isatty` wrapper.
- Panic-free error handling.
- Special keys events (modifiers, special keys, etc.).
- Allocation-free.

View File

@ -7,7 +7,7 @@ use termion::input::{TermRead, Key};
use std::io::{Write, stdout, stdin};
fn rainbow<W: Write>(stdout: &mut W, blue: u8) {
write!(stdout, "{}", termion::cursor::Goto(1, 1)).unwrap();
write!(stdout, "{}{}", termion::cursor::Goto(1, 1), termion::clear::All).unwrap();
for red in (0..255).step_by(8 as u8) {
for green in (0..255).step_by(4) {
@ -28,7 +28,7 @@ fn main() {
termion::cursor::Goto(1, 1),
termion::cursor::Hide).unwrap();
let mut blue = 0u8;
let mut blue = 172u8;
for c in stdin.keys() {
match c.unwrap() {