Update readme, fix rainbow example
This commit is contained in:
parent
e36ff1c71b
commit
b17d0151d9
|
@ -37,7 +37,7 @@ default-features = false
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Raw mode.
|
- Raw mode.
|
||||||
- Truecolor.
|
- TrueColor.
|
||||||
- 256-color mode.
|
- 256-color mode.
|
||||||
- Cursor movement.
|
- Cursor movement.
|
||||||
- Color output.
|
- Color output.
|
||||||
|
@ -48,6 +48,7 @@ default-features = false
|
||||||
- Termios control.
|
- Termios control.
|
||||||
- Password input.
|
- Password input.
|
||||||
- Redox support.
|
- Redox support.
|
||||||
|
- Safe `isatty` wrapper.
|
||||||
- Panic-free error handling.
|
- Panic-free error handling.
|
||||||
- Special keys events (modifiers, special keys, etc.).
|
- Special keys events (modifiers, special keys, etc.).
|
||||||
- Allocation-free.
|
- Allocation-free.
|
||||||
|
|
|
@ -7,7 +7,7 @@ use termion::input::{TermRead, Key};
|
||||||
use std::io::{Write, stdout, stdin};
|
use std::io::{Write, stdout, stdin};
|
||||||
|
|
||||||
fn rainbow<W: Write>(stdout: &mut W, blue: u8) {
|
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 red in (0..255).step_by(8 as u8) {
|
||||||
for green in (0..255).step_by(4) {
|
for green in (0..255).step_by(4) {
|
||||||
|
@ -28,7 +28,7 @@ fn main() {
|
||||||
termion::cursor::Goto(1, 1),
|
termion::cursor::Goto(1, 1),
|
||||||
termion::cursor::Hide).unwrap();
|
termion::cursor::Hide).unwrap();
|
||||||
|
|
||||||
let mut blue = 0u8;
|
let mut blue = 172u8;
|
||||||
|
|
||||||
for c in stdin.keys() {
|
for c in stdin.keys() {
|
||||||
match c.unwrap() {
|
match c.unwrap() {
|
||||||
|
|
Loading…
Reference in New Issue