Skip to content

Commit

Permalink
Updated readme, added examples
Browse files Browse the repository at this point in the history
  • Loading branch information
prashnts committed Oct 2, 2016
1 parent dfcdc3d commit 827b029
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Hues
This is the 90s and your terminal can display _16_ glorious colors. Your Python scripts deserve the some color love. `Hues` makes printing to console in color easy. Just grab the package from `PIP`, and your monochromatic days will be a thing of past!

This is the 90s and your terminal can display _16_ glorious colors.
Your Python scripts deserve the some color love. `Hues` makes printing
to console in color easy. Just grab the package from `PIP`, and your
monochromatic days will be a thing of past!


![Preview](docs/preview.jpg)


## Quickstart
Expand All @@ -18,21 +25,41 @@ Then, in your scripts, do this:
>>> hues.info('42')
```

_whoa!_

### Configuration

[TODO]
You can add a `.hues.yml` file in your projects, or your home directory,
overriding the defaults. The configuration files are searched and loaded
in this order:

_whoa!_
- Packaged configuration
- User home directory
- Current directory and all the parent directories

Check out the default configuration [here](hues/.hues.yml).
Currently there's a `powerline` theme shipped with the package which
you can enable by updating `theme` value in configuration.

All the colors, styles and backgrounds are available as object attributes. The chainable syntax is optimized deterministically using a push down automaton, so when you're being particularly indecisive, you can:

## Creating your own prompts

`hues` makes it easy to create your own custom prompt formats with a
Hue String. Hue string is a thin wrapper around Python strings adding
a chainable syntax that's a joy to use!

```python
>>> print(hue('MONDAY!').bold.red.bg_green.underline.bright_yellow)
>>> import hues
>>> print(hues.huestr(' 42 ').white.bg_blue.bold.colorized)
```

and there won't be a single trace of `red` in your `bright yellow` message to mondays.
It does exactly what it says:

![Example](docs/example-custom.jpg)

Each `hue` string is self closing, so you can't accidentally color your whole terminal yellow because you forgot the `reset` escape sequence.
The Hue string chained attributes use a deterministic pushdown automata
for optimizing the attribute access, so the ANSI escaped strings are
always optimal.


## Colors
Expand All @@ -41,8 +68,13 @@ All 16 glorious ANSI colors are available for both background and foreground. As


## Todo
- [ ] Expand this readme.
- [ ] Add screenshots!
- [ ] More Documentation.
- [ ] Unicorns required.

Please contribute by opening issues, suggestions and patches.

If you like `hues` or use it in your project, I'd love to hear about it!
Shout at me on [tumblr](//doom.noop.pw) or send me an email.


> Back in my days, we didn't even have colors!
Binary file modified docs/assets.sketch
Binary file not shown.
Binary file added docs/example-custom.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/preview.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 827b029

Please sign in to comment.