• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

huepy/H19-Dec-2019-7859

huepy.egg-info/H03-May-2022-2726

LICENSEH A D19-Dec-201934.3 KiB674553

PKG-INFOH A D19-Dec-20191 KiB2726

README.mdH A D19-Dec-20193.1 KiB13798

setup.cfgH A D19-Dec-201973 85

setup.pyH A D19-Dec-20191.6 KiB5143

README.md

1# Hue
2
3![Hue Logo](https://i.imgur.com/Pxe9la8.png)
4
5Hue provides a minimal and powerful interface to print colored text and labels
6in the terminal.\ It works with Python 2 as well as Python 3.
7
8What makes hue better than other coloring libraries? [Here's a
9comparison.](#why-hue)
10
11## Supported Stuff
12
13Following styles are supported
14
15![Hue Styles](https://i.imgur.com/899ZtQy.png)
16
17Following colors are supported
18
19![Hue Colors](https://i.imgur.com/9tWvPkD.png)
20
21Following labels are supported
22
23![Hue Labels](https://i.imgur.com/8qBq0Zd.png)
24
25
26### Installation
27You can install `hue` with **pip** as follows:
28```
29pip install huepy
30```
31or with **easy_install**:
32```
33easy_install huepy
34```
35
36### Usage
37First of all, import everything that Hue has to offer as follows:
38
39```python
40from huepy import *
41```
42
43Printing colored text is as simple as doing
44
45```python
46print(red('This string is red'))
47```
48
49Easy right?
50But what if you want to print italic text?
51You can simply do this
52
53```python
54print(italic('This string is in italic'))
55```
56
57You can also combine styles and colors
58
59```python
60print(bold(red('This string is bold and red')))
61```
62
63Output:
64![Output Examples](https://i.imgur.com/Lo7ZyHq.png)
65
66And what is the use of those labels?\
67I have been using these labels in projects as a minimal output schema.\
68If some error occured in your program or something else bad happened you don't need to print the whole line in red. With hue, you can simply do this
69
70```python
71print(bad('An error occured.'))
72```
73
74Take a look at the output of all the labels
75![Label Examples](https://i.imgur.com/b4Kj5Ym.png)
76
77#### List of all colors
78
79```python
80white, grey, black, green, lightgreen, cyan, lightcyan, red, lightred,
81blue, lightblue, purple, light purple, orange, yellow
82```
83
84#### List of all styles
85
86```python
87bold, bg, under, strike, italic
88```
89
90#### List of all labels
91
92```python
93info, que, run, bad, good
94```
95
96**Note:** Windows versions below windows 10 do not support ANSI escape sequences so the colors will not be printed in command prompt.
97
98### Why hue
99
100Because its awesome!
101Lets print a red colored string in popular coloring libraries:
102
103- Colorama
104```python
105from colorama import Fore
106print(Fore.RED + 'This string is red')
107```
108- Termcolor
109```python
110import sys
111from termcolor import colored, cprint
112print(colored('This string is red', 'red'))
113```
114- Hue
115```python
116from hue import *
117print(red('This string is red'))
118```
119Here's comparison table:
120
121|             |Hue              |Colorama      |Termcolor|
122|-------------|-----------------|--------------|---------|
123|Compatibility|Unix & Windows 10|Unix & Windows|Unix     |
124|Ease of use  |10/10            |4/10          |5/10     |
125|Bright Colors|Yes              |No            |No       |
126
127**Note:** Colorama and Termcolor print bold styled strings when asked for
128bright colored strings. On the other hand, Hue supports both bright and bold
129strings. Also the *Ease to use* ratings are a result of my own experience and
130may differ for others.
131
132### Contribution
133
134The only thing I think **Hue** needs is better windows compatibility. So if
135you can start a pull request for windows support that would be great.
136Additional colors and labels will be appreciated too.
137