README.md in pastel-0.1.0 vs README.md in pastel-0.2.0
- old
+ new
@@ -9,10 +9,12 @@
Terminal output styling with intuitive and clean API that doesn't monkey patch String class.
**Pastel** is minimal and focused to work in all terminal emulators.
+![screenshot](https://github.com/peter-murach/pastel/raw/master/assets/screenshot.png)
+
## Features
* Doesn't monkey patch `String`
* Intuitive and expressive API
* Minimal and focused to work on all terminal emulators
@@ -40,10 +42,11 @@
* [2.1 Color](#21-color)
* [2.2 Decorate](#22-decorate)
* [2.3 Strip](#23-strip)
* [2.4 Styles](#24-styles)
* [2.5 Valid?](#25-valid)
+ * [2.6 Enabled?](#26-enabled)
* [3. The available styles](#3-the-available-styles)
## 1 Usage
**Pastel** provides a simple, minimal and intuitive API for styling your strings:
@@ -64,11 +67,11 @@
```ruby
pastel.red.on_green.bold('Unicorns!')
```
-It supports variable number of arguments with individual styling:
+It supports variable number of arguments:
```ruby
pastel.red('Unicorns', 'are', 'running', 'everywhere!')
```
@@ -83,11 +86,11 @@
### 2.1 Color
You can pass variable number of styled strings like so:
```ruby
-pastel.red('Unicorns', pastel.on_yellow('are running', pastel.bold.underline('everywhere')), '!')
+pastel.red('Unicorns ', pastel.bold.underline('everywhere'), '!')
```
Please refer to [3. The available styles](#3-the-available-styles) section for full list of supported styles.
### 2.2 Decorate
@@ -119,9 +122,24 @@
Determine whether a color is valid:
```ruby
pastel.valid?(:red) # => true
pastel.valid?(:unicorn) # => false
+```
+
+### 2.6 Enabled?
+
+In order to detect if your terminal supports coloring do:
+
+```ruby
+pastel.enabled? # => false
+```
+
+In cases when the color support is not provided no styling will be applied to the colored string. Moreover, you can force **Pastel** to always print out string with coloring switched on:
+
+```ruby
+pastel = Pastel.new(enabled: true)
+pastel.enabled? # => false
```
## 3 The available styles
**Pastel** works with terminal emulators that support minimum sixteen colors. It provides `16` basic colors and `8` styles with further `16` bright color pairs. The corresponding bright color is obtained by prepending the `bright` to the normal color name. For example, color `red` will have `bright_red` as its pair.