Skip to content

Commit

Permalink
feat(readme): V2
Browse files Browse the repository at this point in the history
  • Loading branch information
riezebosch committed Feb 9, 2021
1 parent 2412b15 commit b753a51
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,67 @@
[![build](https://ci.appveyor.com/api/projects/status/8dnbd2u8t737lm21/branch/master?svg=true)](https://ci.appveyor.com/project/riezebosch/crayon/branch/master)
[![nuget](https://img.shields.io/nuget/v/Crayon.svg)](https://www.nuget.org/packages/Crayon/)

# Crayon
# 🖍 Crayon
An easy peasy tiny library for coloring console output in inline strings using ANSI escape codes.

# V2

The API has changed to support background colors.
I dropped the extension methods on string and opted for the using static directive instead.
All methods now have an overload for direct input so you no longer have to end with a `Text()` invocation.

## Examples

```c#
using static Crayon.Output;

Console.WriteLine(Green($"green {Red($"{Bold("bold")} red")} green"));
Console.WriteLine(Bright.Blue($"Bright {Green("and normal green")}"));
Console.WriteLine(Green($"The difference {Bold("between bold")} and {Bright.Green("bright green")}"));
Console.WriteLine(Bold().Green().Text($"starting green {Red("then red")} must be green again"));
```

![screenshot](screenshot.png)

## Colors

```c#
Black()
Red()
Green()
Yellow()
Blue()
Magenta()
Cyan()
White()
```

```c#
Rgb(r, g, b)
```

```c#
Background.Blue()
Bright.Blue()
```

## Decorations

```c#
Bold()
Dim()
Underline()
Reversed()
```

## Text

```c#
Blue().Underline().Text("input")
Blue().Underline("input")
```

All colors and decorations have an overload with direct input and terminating the formatter.

## Rainbows 🌈

Thanks to [DevinR528](https://github.com/devinRagotzy) we now have rainbows!
Expand Down

0 comments on commit b753a51

Please sign in to comment.