From 8d94c382063cc4db4df3dad3fe06a7ad90bcdba6 Mon Sep 17 00:00:00 2001 From: Timon Date: Thu, 18 Jan 2018 08:31:13 +0100 Subject: [PATCH] Update README.md Changed styling example --- README.md | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5b4a240..6db5d78 100644 --- a/README.md +++ b/README.md @@ -40,19 +40,12 @@ Documentation for the code can be found here ... For detailed examples of all crossterm functionalities check the `./examples/` direcory. ### Styled font -``` - // Pass an string to the `paint()` method with you want to paint. - // This will give you an object back wits can be styled and displayed. - let mut styledobject = paint("Red font on blue background color"); - // Set the foreground color. - styledobject = styledobject.with(Color::Red); - // Set the background color. - styledobject = styledobject.on(Color::Blue); - // Print the styled object with the foregroundcolor `Red` and backgroundcolor `Blue` - println!("{}", styledobject); - - // Crossterm provides method chaining so that the above points can be inlined. +```rust + // Crossterm provides method chaining so that the methods can be inlined. println!("{}", paint("Red font on blue background color").with(Color::Red).on(Color::Blue)); + + // Crossterm provides method chaining so that the methods can be inlined. + println!("{}", paint("Red font on default background color").with(Color::Red)); ``` ### Cursor