Name | pycolurate JSON |
Version |
1.24
JSON |
| download |
home_page | https://gitlab.com |
Summary | Simple library for color and formatting to terminal |
upload_time | 2023-02-09 07:12:19 |
maintainer | |
docs_url | None |
author | dslackw |
requires_python | |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
Very simple Python library for color and formatting in terminal.
Collection of color codes and names for 256 color terminal setups.
The following is a list of 256 colors for Xterm, containing an example
of the displayed color, Xterm Name, Xterm Number and HEX.
The following colors works with most terminals and terminals emulators.
ANSI/VT100 escape sequences can be used in every programming languages.
Attributes:
.. code-block:: bash
+-----+------------------+
|Code | Description |
+-----+------------------+
| 1 | bold |
| 2 | dim |
| 4 | underlined |
| 5 | blink |
| 7 | reverse |
| 8 | hidden |
| 0 | reset |
| 21 | res_bold |
| 22 | res_dim |
| 24 | res_underlined |
| 25 | res_blink |
| 27 | res_reverse |
| 28 | res_hidden |
+------------------------+
256 Foreground and Background Colors - Full Chart:
.. code-block:: bash
+-----+---------------------+
|Code | Description |
+-----+---------------------+
| 0 | black |
| 1 | red |
| 2 | green |
| 3 | yellow |
| 4 | blue |
| 5 | magenta |
| 6 | cyan |
| 7 | light_gray |
| 8 | dark_gray |
| 9 | light_red |
| 10 | light_green |
| 11 | light_yellow |
| 12 | light_blue |
| 13 | light_magenta |
| 14 | light_cyan |
| 15 | white |
| 16 | grey_0 |
| 17 | navy_blue |
| 18 | dark_blue |
| 19 | blue_3a |
| 20 | blue_3b |
| 21 | blue_1 |
| 22 | dark_green |
| 23 | deep_sky_blue_4a |
| 24 | deep_sky_blue_4b |
| 25 | deep_sky_blue_4c |
| 26 | dodger_blue_3 |
| 27 | dodger_blue_2 |
| 28 | green_4 |
| 29 | spring_green_4 |
| 30 | turquoise_4 |
| 31 | deep_sky_blue_3a |
| 32 | deep_sky_blue_3b |
| 33 | dodger_blue_1 |
| 34 | green_3a |
| 35 | spring_green_3a |
| 36 | dark_cyan |
| 37 | light_sea_green |
| 38 | deep_sky_blue_2 |
| 39 | deep_sky_blue_1 |
| 40 | green_3b |
| 41 | spring_green_3b |
| 42 | spring_green_2a |
| 43 | cyan_3 |
| 44 | dark_turquoise |
| 45 | turquoise_2 |
| 46 | green_1 |
| 47 | spring_green_2b |
| 48 | spring_green_1 |
| 49 | medium_spring_green |
| 50 | cyan_2 |
| 51 | cyan_1 |
| 52 | dark_red_1 |
| 53 | deep_pink_4a |
| 54 | purple_4a |
| 55 | purple_4b |
| 56 | purple_3 |
| 57 | blue_violet |
| 58 | orange_4a |
| 59 | grey_37 |
| 60 | medium_purple_4 |
| 61 | slate_blue_3a |
| 62 | slate_blue_3b |
| 63 | royal_blue_1 |
| 64 | chartreuse_4 |
| 65 | dark_sea_green_4a |
| 66 | pale_turquoise_4 |
| 67 | steel_blue |
| 68 | steel_blue_3 |
| 69 | cornflower_blue |
| 70 | chartreuse_3a |
| 71 | dark_sea_green_4b |
| 72 | cadet_blue_2 |
| 73 | cadet_blue_1 |
| 74 | sky_blue_3 |
| 75 | steel_blue_1a |
| 76 | chartreuse_3b |
| 77 | pale_green_3a |
| 78 | sea_green_3 |
| 79 | aquamarine_3 |
| 80 | medium_turquoise |
| 81 | steel_blue_1b |
| 82 | chartreuse_2a |
| 83 | sea_green_2 |
| 84 | sea_green_1a |
| 85 | sea_green_1b |
| 86 | aquamarine_1a |
| 87 | dark_slate_gray_2 |
| 88 | dark_red_2 |
| 89 | deep_pink_4b |
| 90 | dark_magenta_1 |
| 91 | dark_magenta_2 |
| 92 | dark_violet_1a |
| 93 | purple_1a |
| 94 | orange_4b |
| 95 | light_pink_4 |
| 96 | plum_4 |
| 97 | medium_purple_3a |
| 98 | medium_purple_3b |
| 99 | slate_blue_1 |
| 100 | yellow_4a |
| 101 | wheat_4 |
| 102 | grey_53 |
| 103 | light_slate_grey |
| 104 | medium_purple |
| 105 | light_slate_blue |
| 106 | yellow_4b |
| 107 | dark_olive_green_3a |
| 108 | dark_green_sea |
| 109 | light_sky_blue_3a |
| 110 | light_sky_blue_3b |
| 111 | sky_blue_2 |
| 112 | chartreuse_2b |
| 113 | dark_olive_green_3b |
| 114 | pale_green_3b |
| 115 | dark_sea_green_3a |
| 116 | dark_slate_gray_3 |
| 117 | sky_blue_1 |
| 118 | chartreuse_1 |
| 119 | light_green_2 |
| 120 | light_green_3 |
| 121 | pale_green_1a |
| 122 | aquamarine_1b |
| 123 | dark_slate_gray_1 |
| 124 | red_3a |
| 125 | deep_pink_4c |
| 126 | medium_violet_red |
| 127 | magenta_3a |
| 128 | dark_violet_1b |
| 129 | purple_1b |
| 130 | dark_orange_3a |
| 131 | indian_red_1a |
| 132 | hot_pink_3a |
| 133 | medium_orchid_3 |
| 134 | medium_orchid |
| 135 | medium_purple_2a |
| 136 | dark_goldenrod |
| 137 | light_salmon_3a |
| 138 | rosy_brown |
| 139 | grey_63 |
| 140 | medium_purple_2b |
| 141 | medium_purple_1 |
| 142 | gold_3a |
| 143 | dark_khaki |
| 144 | navajo_white_3 |
| 145 | grey_69 |
| 146 | light_steel_blue_3 |
| 147 | light_steel_blue |
| 148 | yellow_3a |
| 149 | dark_olive_green_3 |
| 150 | dark_sea_green_3b |
| 151 | dark_sea_green_2 |
| 152 | light_cyan_3 |
| 153 | light_sky_blue_1 |
| 154 | green_yellow |
| 155 | dark_olive_green_2 |
| 156 | pale_green_1b |
| 157 | dark_sea_green_5b |
| 158 | dark_sea_green_5a |
| 159 | pale_turquoise_1 |
| 160 | red_3b |
| 161 | deep_pink_3a |
| 162 | deep_pink_3b |
| 163 | magenta_3b |
| 164 | magenta_3c |
| 165 | magenta_2a |
| 166 | dark_orange_3b |
| 167 | indian_red_1b |
| 168 | hot_pink_3b |
| 169 | hot_pink_2 |
| 170 | orchid |
| 171 | medium_orchid_1a |
| 172 | orange_3 |
| 173 | light_salmon_3b |
| 174 | light_pink_3 |
| 175 | pink_3 |
| 176 | plum_3 |
| 177 | violet |
| 178 | gold_3b |
| 179 | light_goldenrod_3 |
| 180 | tan |
| 181 | misty_rose_3 |
| 182 | thistle_3 |
| 183 | plum_2 |
| 184 | yellow_3b |
| 185 | khaki_3 |
| 186 | light_goldenrod_2a |
| 187 | light_yellow_3 |
| 188 | grey_84 |
| 189 | light_steel_blue_1 |
| 190 | yellow_2 |
| 191 | dark_olive_green_1a |
| 192 | dark_olive_green_1b |
| 193 | dark_sea_green_1 |
| 194 | honeydew_2 |
| 195 | light_cyan_1 |
| 196 | red_1 |
| 197 | deep_pink_2 |
| 198 | deep_pink_1a |
| 199 | deep_pink_1b |
| 200 | magenta_2b |
| 201 | magenta_1 |
| 202 | orange_red_1 |
| 203 | indian_red_1c |
| 204 | indian_red_1d |
| 205 | hot_pink_1a |
| 206 | hot_pink_1b |
| 207 | medium_orchid_1b |
| 208 | dark_orange |
| 209 | salmon_1 |
| 210 | light_coral |
| 211 | pale_violet_red_1 |
| 212 | orchid_2 |
| 213 | orchid_1 |
| 214 | orange_1 |
| 215 | sandy_brown |
| 216 | light_salmon_1 |
| 217 | light_pink_1 |
| 218 | pink_1 |
| 219 | plum_1 |
| 220 | gold_1 |
| 221 | light_goldenrod_2b |
| 222 | light_goldenrod_2c |
| 223 | navajo_white_1 |
| 224 | misty_rose1 |
| 225 | thistle_1 |
| 226 | yellow_1 |
| 227 | light_goldenrod_1 |
| 228 | khaki_1 |
| 229 | wheat_1 |
| 230 | cornsilk_1 |
| 231 | grey_100 |
| 232 | grey_3 |
| 233 | grey_7 |
| 234 | grey_11 |
| 235 | grey_15 |
| 236 | grey_19 |
| 237 | grey_23 |
| 238 | grey_27 |
| 239 | grey_30 |
| 240 | grey_35 |
| 241 | grey_39 |
| 242 | grey_42 |
| 243 | grey_46 |
| 244 | grey_50 |
| 245 | grey_54 |
| 246 | grey_58 |
| 247 | grey_62 |
| 248 | grey_66 |
| 249 | grey_70 |
| 250 | grey_74 |
| 251 | grey_78 |
| 252 | grey_82 |
| 253 | grey_85 |
| 254 | grey_89 |
| 255 | grey_93 |
| 256 | default |
+-----+---------------------+
256 Colors Foreground (text):
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/256_colors_fg.png
:alt: 256 fg colors
256 Colors Background:
.. image:: https://gitlab.com/dslackw/images/raw/master/colored/256_colors_bg.png
:alt: 256 bg colors
Installation
------------
.. code-block:: bash
$ pip install pycolurate --upgrade
uninstall
$ pip uninstall pycolurate
Dependencies
------------
None, only Python programming language.
Usage Examples
--------------
How to use the module in your own python code:
.. code-block:: bash
>>> from pycolurate import fg, bg, attr
>>>
>>> print(f'{fg(1)} Hello World !!! {attr(0)}')
Hello World !!!
>>>
>>> print(f'{fg(1)}{bg(15)} Hello World !!! {attr(0)}')
Hello World !!!
Use description:
.. code-block:: bash
>>> print(f'{fg("white")}{bg("yellow")} Hello World !!! {attr("reset")}')
Hello World !!!
>>>
>>> print(f'{fg("orchid")}{attr("bold")} Hello World !!! {attr("reset")}')
Hello World !!!
>>>
>>> color = bg('indian_red_1a') + fg('white')
>>> reset = attr('reset')
>>> print(color + 'Hello World !!!' + reset)
Hello World !!!
Or use HEX code:
.. code-block:: bash
>>> color = fg('#C0C0C0') + bg('#00005f')
>>> res = attr('reset')
>>> print(color + "Hello World !!!" + res)
Hello World !!!
Or the convenient `stylize(text, *styles)` wrapper to save some keystrokes:
.. code-block:: bash
>>> import pycolurate
>>> from pycolurate import stylize
>>> print(stylize("This is green.", colored.fg("green")))
This is green.
>>> print("This is not.")
This is not.
>>> angry = colored.fg("red") + colored.attr("bold")
>>> print(stylize("This is angry text.", angry))
This is angry text.
>>> print(stylize("This is VERY angry text.", angry, pycolurate.attr("underlined")))
This is VERY angry text.
>>> print("But this is not.")
But this is not.
Or the variant `stylize_interactive(text, *styles)` for readline-friendliness:
.. code-block:: bash
>>> import pycolurate, sys
>>> from pycolurate import stylize_interactive, fg
>>> sys.ps1 = stylize_interactive("myPrompt: ", fg('red'))
myPrompt:
Use directly like `colorama <https://pypi.python.org/pypi/colorama>`_ but with more colors:
.. code-block:: bash
>>> from pycolurate import fore, back, style
>>>
>>> print(fore.LIGHT_BLUE + back.RED + style.BOLD + "Hello World !!!" + style.RESET)
Import colored module:
.. code-block:: bash
>>> import pycolurate
>>>
>>> pycolurate.fg(1)
'\x1b[38;5;1m'
>>>
>>> colored.fg(257)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib64/python2.7/site-packages/colored/colored.py", line 381, in fg
return colored(color).foreground()
File "/usr/lib64/python2.7/site-packages/colored/colored.py", line 350, in foreground
color = self.reserve_paint[str(self.color)]
KeyError: '257'
>>>
>>> pycolurate.bg(30)
'\x1b[48;5;30m'
>>>
>>> pycolurate.fore.BLUE
'\x1b[38;5;4m'
etc.
Raw data
{
"_id": null,
"home_page": "https://gitlab.com",
"name": "pycolurate",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "dslackw",
"author_email": "zlatanidis@gamil.com",
"download_url": "https://files.pythonhosted.org/packages/ae/df/0ebe2be8c49553c56b7a959c19f4dfa88db4d87edc3e2f9ca651b1795b26/pycolurate-1.24.tar.gz",
"platform": null,
"description": "Very simple Python library for color and formatting in terminal.\r\nCollection of color codes and names for 256 color terminal setups.\r\nThe following is a list of 256 colors for Xterm, containing an example\r\nof the displayed color, Xterm Name, Xterm Number and HEX.\r\n\r\n\r\nThe following colors works with most terminals and terminals emulators.\r\nANSI/VT100 escape sequences can be used in every programming languages.\r\n\r\nAttributes:\r\n\r\n.. code-block:: bash\r\n\r\n +-----+------------------+\r\n |Code | Description |\r\n +-----+------------------+\r\n | 1 | bold |\r\n | 2 | dim |\r\n | 4 | underlined |\r\n | 5 | blink |\r\n | 7 | reverse |\r\n | 8 | hidden |\r\n | 0 | reset |\r\n | 21 | res_bold |\r\n | 22 | res_dim |\r\n | 24 | res_underlined |\r\n | 25 | res_blink |\r\n | 27 | res_reverse |\r\n | 28 | res_hidden |\r\n +------------------------+\r\n\r\n\r\n256 Foreground and Background Colors - Full Chart:\r\n\r\n.. code-block:: bash\r\n\r\n +-----+---------------------+\r\n |Code | Description |\r\n +-----+---------------------+\r\n | 0 | black |\r\n | 1 | red |\r\n | 2 | green |\r\n | 3 | yellow |\r\n | 4 | blue |\r\n | 5 | magenta |\r\n | 6 | cyan |\r\n | 7 | light_gray |\r\n | 8 | dark_gray |\r\n | 9 | light_red |\r\n | 10 | light_green |\r\n | 11 | light_yellow |\r\n | 12 | light_blue |\r\n | 13 | light_magenta |\r\n | 14 | light_cyan |\r\n | 15 | white |\r\n | 16 | grey_0 |\r\n | 17 | navy_blue |\r\n | 18 | dark_blue |\r\n | 19 | blue_3a |\r\n | 20 | blue_3b |\r\n | 21 | blue_1 |\r\n | 22 | dark_green |\r\n | 23 | deep_sky_blue_4a |\r\n | 24 | deep_sky_blue_4b |\r\n | 25 | deep_sky_blue_4c |\r\n | 26 | dodger_blue_3 |\r\n | 27 | dodger_blue_2 |\r\n | 28 | green_4 |\r\n | 29 | spring_green_4 |\r\n | 30 | turquoise_4 |\r\n | 31 | deep_sky_blue_3a |\r\n | 32 | deep_sky_blue_3b |\r\n | 33 | dodger_blue_1 |\r\n | 34 | green_3a |\r\n | 35 | spring_green_3a |\r\n | 36 | dark_cyan |\r\n | 37 | light_sea_green |\r\n | 38 | deep_sky_blue_2 |\r\n | 39 | deep_sky_blue_1 |\r\n | 40 | green_3b |\r\n | 41 | spring_green_3b |\r\n | 42 | spring_green_2a |\r\n | 43 | cyan_3 |\r\n | 44 | dark_turquoise |\r\n | 45 | turquoise_2 |\r\n | 46 | green_1 |\r\n | 47 | spring_green_2b |\r\n | 48 | spring_green_1 |\r\n | 49 | medium_spring_green |\r\n | 50 | cyan_2 |\r\n | 51 | cyan_1 |\r\n | 52 | dark_red_1 |\r\n | 53 | deep_pink_4a |\r\n | 54 | purple_4a |\r\n | 55 | purple_4b |\r\n | 56 | purple_3 |\r\n | 57 | blue_violet |\r\n | 58 | orange_4a |\r\n | 59 | grey_37 |\r\n | 60 | medium_purple_4 |\r\n | 61 | slate_blue_3a |\r\n | 62 | slate_blue_3b |\r\n | 63 | royal_blue_1 |\r\n | 64 | chartreuse_4 |\r\n | 65 | dark_sea_green_4a |\r\n | 66 | pale_turquoise_4 |\r\n | 67 | steel_blue |\r\n | 68 | steel_blue_3 |\r\n | 69 | cornflower_blue |\r\n | 70 | chartreuse_3a |\r\n | 71 | dark_sea_green_4b |\r\n | 72 | cadet_blue_2 |\r\n | 73 | cadet_blue_1 |\r\n | 74 | sky_blue_3 |\r\n | 75 | steel_blue_1a |\r\n | 76 | chartreuse_3b |\r\n | 77 | pale_green_3a |\r\n | 78 | sea_green_3 |\r\n | 79 | aquamarine_3 |\r\n | 80 | medium_turquoise |\r\n | 81 | steel_blue_1b |\r\n | 82 | chartreuse_2a |\r\n | 83 | sea_green_2 |\r\n | 84 | sea_green_1a |\r\n | 85 | sea_green_1b |\r\n | 86 | aquamarine_1a |\r\n | 87 | dark_slate_gray_2 |\r\n | 88 | dark_red_2 |\r\n | 89 | deep_pink_4b |\r\n | 90 | dark_magenta_1 |\r\n | 91 | dark_magenta_2 |\r\n | 92 | dark_violet_1a |\r\n | 93 | purple_1a |\r\n | 94 | orange_4b |\r\n | 95 | light_pink_4 |\r\n | 96 | plum_4 |\r\n | 97 | medium_purple_3a |\r\n | 98 | medium_purple_3b |\r\n | 99 | slate_blue_1 |\r\n | 100 | yellow_4a |\r\n | 101 | wheat_4 |\r\n | 102 | grey_53 |\r\n | 103 | light_slate_grey |\r\n | 104 | medium_purple |\r\n | 105 | light_slate_blue |\r\n | 106 | yellow_4b |\r\n | 107 | dark_olive_green_3a |\r\n | 108 | dark_green_sea |\r\n | 109 | light_sky_blue_3a |\r\n | 110 | light_sky_blue_3b |\r\n | 111 | sky_blue_2 |\r\n | 112 | chartreuse_2b |\r\n | 113 | dark_olive_green_3b |\r\n | 114 | pale_green_3b |\r\n | 115 | dark_sea_green_3a |\r\n | 116 | dark_slate_gray_3 |\r\n | 117 | sky_blue_1 |\r\n | 118 | chartreuse_1 |\r\n | 119 | light_green_2 |\r\n | 120 | light_green_3 |\r\n | 121 | pale_green_1a |\r\n | 122 | aquamarine_1b |\r\n | 123 | dark_slate_gray_1 |\r\n | 124 | red_3a |\r\n | 125 | deep_pink_4c |\r\n | 126 | medium_violet_red |\r\n | 127 | magenta_3a |\r\n | 128 | dark_violet_1b |\r\n | 129 | purple_1b |\r\n | 130 | dark_orange_3a |\r\n | 131 | indian_red_1a |\r\n | 132 | hot_pink_3a |\r\n | 133 | medium_orchid_3 |\r\n | 134 | medium_orchid |\r\n | 135 | medium_purple_2a |\r\n | 136 | dark_goldenrod |\r\n | 137 | light_salmon_3a |\r\n | 138 | rosy_brown |\r\n | 139 | grey_63 |\r\n | 140 | medium_purple_2b |\r\n | 141 | medium_purple_1 |\r\n | 142 | gold_3a |\r\n | 143 | dark_khaki |\r\n | 144 | navajo_white_3 |\r\n | 145 | grey_69 |\r\n | 146 | light_steel_blue_3 |\r\n | 147 | light_steel_blue |\r\n | 148 | yellow_3a |\r\n | 149 | dark_olive_green_3 |\r\n | 150 | dark_sea_green_3b |\r\n | 151 | dark_sea_green_2 |\r\n | 152 | light_cyan_3 |\r\n | 153 | light_sky_blue_1 |\r\n | 154 | green_yellow |\r\n | 155 | dark_olive_green_2 |\r\n | 156 | pale_green_1b |\r\n | 157 | dark_sea_green_5b |\r\n | 158 | dark_sea_green_5a |\r\n | 159 | pale_turquoise_1 |\r\n | 160 | red_3b |\r\n | 161 | deep_pink_3a |\r\n | 162 | deep_pink_3b |\r\n | 163 | magenta_3b |\r\n | 164 | magenta_3c |\r\n | 165 | magenta_2a |\r\n | 166 | dark_orange_3b |\r\n | 167 | indian_red_1b |\r\n | 168 | hot_pink_3b |\r\n | 169 | hot_pink_2 |\r\n | 170 | orchid |\r\n | 171 | medium_orchid_1a |\r\n | 172 | orange_3 |\r\n | 173 | light_salmon_3b |\r\n | 174 | light_pink_3 |\r\n | 175 | pink_3 |\r\n | 176 | plum_3 |\r\n | 177 | violet |\r\n | 178 | gold_3b |\r\n | 179 | light_goldenrod_3 |\r\n | 180 | tan |\r\n | 181 | misty_rose_3 |\r\n | 182 | thistle_3 |\r\n | 183 | plum_2 |\r\n | 184 | yellow_3b |\r\n | 185 | khaki_3 |\r\n | 186 | light_goldenrod_2a |\r\n | 187 | light_yellow_3 |\r\n | 188 | grey_84 |\r\n | 189 | light_steel_blue_1 |\r\n | 190 | yellow_2 |\r\n | 191 | dark_olive_green_1a |\r\n | 192 | dark_olive_green_1b |\r\n | 193 | dark_sea_green_1 |\r\n | 194 | honeydew_2 |\r\n | 195 | light_cyan_1 |\r\n | 196 | red_1 |\r\n | 197 | deep_pink_2 |\r\n | 198 | deep_pink_1a |\r\n | 199 | deep_pink_1b |\r\n | 200 | magenta_2b |\r\n | 201 | magenta_1 |\r\n | 202 | orange_red_1 |\r\n | 203 | indian_red_1c |\r\n | 204 | indian_red_1d |\r\n | 205 | hot_pink_1a |\r\n | 206 | hot_pink_1b |\r\n | 207 | medium_orchid_1b |\r\n | 208 | dark_orange |\r\n | 209 | salmon_1 |\r\n | 210 | light_coral |\r\n | 211 | pale_violet_red_1 |\r\n | 212 | orchid_2 |\r\n | 213 | orchid_1 |\r\n | 214 | orange_1 |\r\n | 215 | sandy_brown |\r\n | 216 | light_salmon_1 |\r\n | 217 | light_pink_1 |\r\n | 218 | pink_1 |\r\n | 219 | plum_1 |\r\n | 220 | gold_1 |\r\n | 221 | light_goldenrod_2b |\r\n | 222 | light_goldenrod_2c |\r\n | 223 | navajo_white_1 |\r\n | 224 | misty_rose1 |\r\n | 225 | thistle_1 |\r\n | 226 | yellow_1 |\r\n | 227 | light_goldenrod_1 |\r\n | 228 | khaki_1 |\r\n | 229 | wheat_1 |\r\n | 230 | cornsilk_1 |\r\n | 231 | grey_100 |\r\n | 232 | grey_3 |\r\n | 233 | grey_7 |\r\n | 234 | grey_11 |\r\n | 235 | grey_15 |\r\n | 236 | grey_19 |\r\n | 237 | grey_23 |\r\n | 238 | grey_27 |\r\n | 239 | grey_30 |\r\n | 240 | grey_35 |\r\n | 241 | grey_39 |\r\n | 242 | grey_42 |\r\n | 243 | grey_46 |\r\n | 244 | grey_50 |\r\n | 245 | grey_54 |\r\n | 246 | grey_58 |\r\n | 247 | grey_62 |\r\n | 248 | grey_66 |\r\n | 249 | grey_70 |\r\n | 250 | grey_74 |\r\n | 251 | grey_78 |\r\n | 252 | grey_82 |\r\n | 253 | grey_85 |\r\n | 254 | grey_89 |\r\n | 255 | grey_93 |\r\n | 256 | default |\r\n +-----+---------------------+\r\n\r\n256 Colors Foreground (text):\r\n\r\n.. image:: https://gitlab.com/dslackw/images/raw/master/colored/256_colors_fg.png\r\n :alt: 256 fg colors\r\n\r\n256 Colors Background:\r\n\r\n.. image:: https://gitlab.com/dslackw/images/raw/master/colored/256_colors_bg.png\r\n :alt: 256 bg colors\r\n\r\n\r\nInstallation\r\n------------\r\n\r\n.. code-block:: bash\r\n\r\n $ pip install pycolurate --upgrade\r\n\r\n uninstall\r\n\r\n $ pip uninstall pycolurate\r\n\r\n\r\nDependencies\r\n------------\r\n\r\nNone, only Python programming language.\r\n\r\nUsage Examples\r\n--------------\r\n\r\nHow to use the module in your own python code:\r\n\r\n.. code-block:: bash\r\n\r\n >>> from pycolurate import fg, bg, attr\r\n >>>\r\n >>> print(f'{fg(1)} Hello World !!! {attr(0)}')\r\n Hello World !!!\r\n >>>\r\n >>> print(f'{fg(1)}{bg(15)} Hello World !!! {attr(0)}')\r\n Hello World !!!\r\n\r\nUse description:\r\n\r\n.. code-block:: bash\r\n\r\n >>> print(f'{fg(\"white\")}{bg(\"yellow\")} Hello World !!! {attr(\"reset\")}')\r\n Hello World !!!\r\n >>>\r\n >>> print(f'{fg(\"orchid\")}{attr(\"bold\")} Hello World !!! {attr(\"reset\")}')\r\n Hello World !!!\r\n >>>\r\n >>> color = bg('indian_red_1a') + fg('white')\r\n >>> reset = attr('reset')\r\n >>> print(color + 'Hello World !!!' + reset)\r\n Hello World !!!\r\n\r\nOr use HEX code:\r\n\r\n.. code-block:: bash\r\n\r\n >>> color = fg('#C0C0C0') + bg('#00005f')\r\n >>> res = attr('reset')\r\n >>> print(color + \"Hello World !!!\" + res)\r\n Hello World !!!\r\n\r\nOr the convenient `stylize(text, *styles)` wrapper to save some keystrokes:\r\n\r\n.. code-block:: bash\r\n\r\n >>> import pycolurate\r\n >>> from pycolurate import stylize\r\n >>> print(stylize(\"This is green.\", colored.fg(\"green\")))\r\n This is green.\r\n >>> print(\"This is not.\")\r\n This is not.\r\n >>> angry = colored.fg(\"red\") + colored.attr(\"bold\")\r\n >>> print(stylize(\"This is angry text.\", angry))\r\n This is angry text.\r\n >>> print(stylize(\"This is VERY angry text.\", angry, pycolurate.attr(\"underlined\")))\r\n This is VERY angry text.\r\n >>> print(\"But this is not.\")\r\n But this is not.\r\n\r\nOr the variant `stylize_interactive(text, *styles)` for readline-friendliness:\r\n\r\n.. code-block:: bash\r\n\r\n >>> import pycolurate, sys\r\n >>> from pycolurate import stylize_interactive, fg\r\n >>> sys.ps1 = stylize_interactive(\"myPrompt: \", fg('red'))\r\n myPrompt:\r\n\r\nUse directly like `colorama <https://pypi.python.org/pypi/colorama>`_ but with more colors:\r\n\r\n.. code-block:: bash\r\n\r\n >>> from pycolurate import fore, back, style\r\n >>>\r\n >>> print(fore.LIGHT_BLUE + back.RED + style.BOLD + \"Hello World !!!\" + style.RESET)\r\n\r\nImport colored module:\r\n\r\n.. code-block:: bash\r\n\r\n >>> import pycolurate\r\n >>>\r\n >>> pycolurate.fg(1)\r\n '\\x1b[38;5;1m'\r\n >>>\r\n >>> colored.fg(257)\r\n Traceback (most recent call last):\r\n File \"<input>\", line 1, in <module>\r\n File \"/usr/lib64/python2.7/site-packages/colored/colored.py\", line 381, in fg\r\n return colored(color).foreground()\r\n File \"/usr/lib64/python2.7/site-packages/colored/colored.py\", line 350, in foreground\r\n color = self.reserve_paint[str(self.color)]\r\n KeyError: '257'\r\n >>>\r\n >>> pycolurate.bg(30)\r\n '\\x1b[48;5;30m'\r\n >>>\r\n >>> pycolurate.fore.BLUE\r\n '\\x1b[38;5;4m'\r\n\r\n etc.\r\n\r\n\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Simple library for color and formatting to terminal",
"version": "1.24",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "fafe4cec5d8bf8af96999910641e50f4d8f61211da75d6ad814860896f11448a",
"md5": "e9779853115d0b4120650c83ca23d86e",
"sha256": "f551ab7f43e96bec743184abbb0398eb6274f53a4b143d20777f9f3212b4127d"
},
"downloads": -1,
"filename": "pycolurate-1.24-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e9779853115d0b4120650c83ca23d86e",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 14963,
"upload_time": "2023-02-09T07:12:17",
"upload_time_iso_8601": "2023-02-09T07:12:17.165127Z",
"url": "https://files.pythonhosted.org/packages/fa/fe/4cec5d8bf8af96999910641e50f4d8f61211da75d6ad814860896f11448a/pycolurate-1.24-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aedf0ebe2be8c49553c56b7a959c19f4dfa88db4d87edc3e2f9ca651b1795b26",
"md5": "4763b3f27e0d29e4babefc028e454533",
"sha256": "c435d931df02ce76364530e937df83e5983832fda3feabac36e563ddc4a924b2"
},
"downloads": -1,
"filename": "pycolurate-1.24.tar.gz",
"has_sig": false,
"md5_digest": "4763b3f27e0d29e4babefc028e454533",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18048,
"upload_time": "2023-02-09T07:12:19",
"upload_time_iso_8601": "2023-02-09T07:12:19.394389Z",
"url": "https://files.pythonhosted.org/packages/ae/df/0ebe2be8c49553c56b7a959c19f4dfa88db4d87edc3e2f9ca651b1795b26/pycolurate-1.24.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-09 07:12:19",
"github": false,
"gitlab": false,
"bitbucket": false,
"lcname": "pycolurate"
}