coloredmatrix


Namecoloredmatrix JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/JewinV/coloredmatrix
SummaryANSI color formatting for output in terminal
upload_time2023-01-02 13:55:16
maintainer
docs_urlNone
authorJewin Varghese
requires_python>=3.9,<4.0
licenseMIT
keywords ansi ansi color ansi colour color colour formatting termcolor terminal console coloredmatrix
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Colored Matrix
![GitHub](https://img.shields.io/github/license/JewinV/colored-console)

A Python library for changing the colors in the terminal using ANSI escape codes.

## Installation
To install Colored Matrix, use **`pip`**:
```bash
pip install coloredmatrix
```

## Usage
To use Colored Matrix, import the Stylize class and the Color constants, and call the desired methods on a Stylize object:
```py
from coloredmatrix import Stylize, Color

# Set the background color to green
print(Stylize("hello").bg_color(Color.Green))

# Set the background color to red
print(Stylize("hello").bg_color(Color.Red))

# Set the background color to green and the foreground color to red
print(Stylize("hello").bg_color(Color.Green).fg_color(Color.Red))

# Set the text to bold and underlined
print(Stylize("hello").bold().underline())

```
You can also pass an RGB color tuple to the bg_color and fg_color methods:
```py
from coloredmatrix import Stylize

# Set the background color to red using an RGB color tuple
print(Stylize("hello").bg_color((255, 0, 0)))

# Set the background color to green using an RGB color tuple
print(Stylize("hello").bg_color((0, 255, 0)))

# Set the background color to red and the foreground color to green using RGB color tuples
print(Stylize("hello").bg_color((255, 0, 0)).fg_color((0, 255, 0)))
```

## Text Styling

The `Stylize` class provides the following methods for styling text:

- `bold`: Makes the text bold
- `italic`: Makes the text italic
- `underline`: Underlines the text
- `blink`: Makes the text blink
- `strike`: Strikes through the text

You can chain these methods to apply multiple styles to the same text. For example:

```python
from coloredmatrix import Stylize

# Set the text to bold, italic, and underlined
print(Stylize("hello").bold().italic().underline())

# Set the text to blink and struck through
print(Stylize("hello").blink().strike())
```

## Supported Colors
You can also use RGB color tuples to specify any other color.
<br>The `Color` constants define the following colors:
| Color Name          | Color Name          | Color Name          | Color Name          | Color Name          |
| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |
| MediumVioletRed     | DeepPink            | PaleVioletRed       | HotPink             | LightPink           |
| Pink                | DarkRed             | Red                 | Firebrick           | Crimson             |
| IndianRed           | LightCoral          | Salmon              | DarkSalmon          | LightSalmon         |
| OrangeRed           | Tomato              | DarkOrange          | Coral               | Orange              |
| DarkKhaki           | Gold                | Khaki               | PeachPuff           | Yellow              |
| PaleGoldenrod       | Moccasin            | PapayaWhip          | LightGoldenrodYellow| LemonChiffon        |
| LightYellow         | Maroon              | Brown               | SaddleBrown         | Sienna              |
| Chocolate           | DarkGoldenrod       | Peru                | RosyBrown           | Goldenrod           |
| SandyBrown          | Tan                 | Burlywood           | Wheat               | NavajoWhite         |
| Bisque              | BlanchedAlmond      | Cornsilk            | Indigo              | Purple              |
| DarkMagenta         | DarkViolet          | DarkSlateBlue       | BlueViolet          | DarkOrchid          |
| Fuchsia             | Magenta             | SlateBlue           | MediumSlateBlue     | MediumOrchid        |
| MediumPurple        | Orchid              | Violet              | Plum                | Thistle             |
| Lavender            | MidnightBlue        | Navy                | DarkBlue            | MediumBlue          |
| Blue                | RoyalBlue           | SteelBlue           | DodgerBlue          | DeepSkyBlue         |
| CornflowerBlue      | SkyBlue             | LightSkyBlue        | LightSteelBlue      | LightBlue           |
| PowderBlue          | Teal                | DarkCyan            | LightSeaGreen       | CadetBlue           |
| DarkTurquoise       | MediumTurquoise     | Turquoise           | Aqua                | Cyan                |
| Aquamarine          | PaleTurquoise       | LightCyan           | DarkGreen           | Green               |
| DarkOliveGreen      | ForestGreen         | SeaGreen            | Olive               | OliveDrab           |
| MediumSeaGreen      | LimeGreen           | Lime                | SpringGreen         | MediumSpringGreen   |
| DarkSeaGreen        | MediumAquamarine    | YellowGreen         | LawnGreen           | Chartreuse          |
| LightGreen          | GreenYellow         | PaleGreen           | MistyRose           | AntiqueWhite        |
| Linen               | Beige               | WhiteSmoke          | LavenderBlush       | OldLace             |
| AliceBlue           | Seashell            | GhostWhite          | Honeydew            | FloralWhite         |
| Azure               | MintCream           | Snow                | Ivory               | White               |
| Black               | DarkSlateGray       | DimGray             | SlateGray           | Gray                |
| LightSlateGray      | DarkGray            | Silver              | LightGray           | Gainsboro           |


## License
License
Colored Matrix is released under the MIT License. See the **LICENSE** file for more information.


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/JewinV/coloredmatrix",
    "name": "coloredmatrix",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "ANSI,ANSI color,ANSI colour,color,colour,formatting,termcolor,terminal,console,coloredmatrix",
    "author": "Jewin Varghese",
    "author_email": "jewinvarghese@protonmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1f/dd/598b27924defe26f32afe5e796e9980753873102e53af39b6fcb00d6b319/coloredmatrix-0.0.2.tar.gz",
    "platform": null,
    "description": "# Colored Matrix\n![GitHub](https://img.shields.io/github/license/JewinV/colored-console)\n\nA Python library for changing the colors in the terminal using ANSI escape codes.\n\n## Installation\nTo install Colored Matrix, use **`pip`**:\n```bash\npip install coloredmatrix\n```\n\n## Usage\nTo use Colored Matrix, import the Stylize class and the Color constants, and call the desired methods on a Stylize object:\n```py\nfrom coloredmatrix import Stylize, Color\n\n# Set the background color to green\nprint(Stylize(\"hello\").bg_color(Color.Green))\n\n# Set the background color to red\nprint(Stylize(\"hello\").bg_color(Color.Red))\n\n# Set the background color to green and the foreground color to red\nprint(Stylize(\"hello\").bg_color(Color.Green).fg_color(Color.Red))\n\n# Set the text to bold and underlined\nprint(Stylize(\"hello\").bold().underline())\n\n```\nYou can also pass an RGB color tuple to the bg_color and fg_color methods:\n```py\nfrom coloredmatrix import Stylize\n\n# Set the background color to red using an RGB color tuple\nprint(Stylize(\"hello\").bg_color((255, 0, 0)))\n\n# Set the background color to green using an RGB color tuple\nprint(Stylize(\"hello\").bg_color((0, 255, 0)))\n\n# Set the background color to red and the foreground color to green using RGB color tuples\nprint(Stylize(\"hello\").bg_color((255, 0, 0)).fg_color((0, 255, 0)))\n```\n\n## Text Styling\n\nThe `Stylize` class provides the following methods for styling text:\n\n- `bold`: Makes the text bold\n- `italic`: Makes the text italic\n- `underline`: Underlines the text\n- `blink`: Makes the text blink\n- `strike`: Strikes through the text\n\nYou can chain these methods to apply multiple styles to the same text. For example:\n\n```python\nfrom coloredmatrix import Stylize\n\n# Set the text to bold, italic, and underlined\nprint(Stylize(\"hello\").bold().italic().underline())\n\n# Set the text to blink and struck through\nprint(Stylize(\"hello\").blink().strike())\n```\n\n## Supported Colors\nYou can also use RGB color tuples to specify any other color.\n<br>The `Color` constants define the following colors:\n| Color Name          | Color Name          | Color Name          | Color Name          | Color Name          |\n| ------------------- | ------------------- | ------------------- | ------------------- | ------------------- |\n| MediumVioletRed     | DeepPink            | PaleVioletRed       | HotPink             | LightPink           |\n| Pink                | DarkRed             | Red                 | Firebrick           | Crimson             |\n| IndianRed           | LightCoral          | Salmon              | DarkSalmon          | LightSalmon         |\n| OrangeRed           | Tomato              | DarkOrange          | Coral               | Orange              |\n| DarkKhaki           | Gold                | Khaki               | PeachPuff           | Yellow              |\n| PaleGoldenrod       | Moccasin            | PapayaWhip          | LightGoldenrodYellow| LemonChiffon        |\n| LightYellow         | Maroon              | Brown               | SaddleBrown         | Sienna              |\n| Chocolate           | DarkGoldenrod       | Peru                | RosyBrown           | Goldenrod           |\n| SandyBrown          | Tan                 | Burlywood           | Wheat               | NavajoWhite         |\n| Bisque              | BlanchedAlmond      | Cornsilk            | Indigo              | Purple              |\n| DarkMagenta         | DarkViolet          | DarkSlateBlue       | BlueViolet          | DarkOrchid          |\n| Fuchsia             | Magenta             | SlateBlue           | MediumSlateBlue     | MediumOrchid        |\n| MediumPurple        | Orchid              | Violet              | Plum                | Thistle             |\n| Lavender            | MidnightBlue        | Navy                | DarkBlue            | MediumBlue          |\n| Blue                | RoyalBlue           | SteelBlue           | DodgerBlue          | DeepSkyBlue         |\n| CornflowerBlue      | SkyBlue             | LightSkyBlue        | LightSteelBlue      | LightBlue           |\n| PowderBlue          | Teal                | DarkCyan            | LightSeaGreen       | CadetBlue           |\n| DarkTurquoise       | MediumTurquoise     | Turquoise           | Aqua                | Cyan                |\n| Aquamarine          | PaleTurquoise       | LightCyan           | DarkGreen           | Green               |\n| DarkOliveGreen      | ForestGreen         | SeaGreen            | Olive               | OliveDrab           |\n| MediumSeaGreen      | LimeGreen           | Lime                | SpringGreen         | MediumSpringGreen   |\n| DarkSeaGreen        | MediumAquamarine    | YellowGreen         | LawnGreen           | Chartreuse          |\n| LightGreen          | GreenYellow         | PaleGreen           | MistyRose           | AntiqueWhite        |\n| Linen               | Beige               | WhiteSmoke          | LavenderBlush       | OldLace             |\n| AliceBlue           | Seashell            | GhostWhite          | Honeydew            | FloralWhite         |\n| Azure               | MintCream           | Snow                | Ivory               | White               |\n| Black               | DarkSlateGray       | DimGray             | SlateGray           | Gray                |\n| LightSlateGray      | DarkGray            | Silver              | LightGray           | Gainsboro           |\n\n\n## License\nLicense\nColored Matrix is released under the MIT License. See the **LICENSE** file for more information.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ANSI color formatting for output in terminal",
    "version": "0.0.2",
    "split_keywords": [
        "ansi",
        "ansi color",
        "ansi colour",
        "color",
        "colour",
        "formatting",
        "termcolor",
        "terminal",
        "console",
        "coloredmatrix"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "7bd00daab9ce10f91a576b70f6095551",
                "sha256": "2f4f4a422c0143895888f68d124223f684a2ef3e81e030f1ddb29183a108d42d"
            },
            "downloads": -1,
            "filename": "coloredmatrix-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7bd00daab9ce10f91a576b70f6095551",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 5720,
            "upload_time": "2023-01-02T13:55:14",
            "upload_time_iso_8601": "2023-01-02T13:55:14.037529Z",
            "url": "https://files.pythonhosted.org/packages/46/a7/ccec18dfc44146d4b3f95013e0cc27237384ee3838d44b303618d1496cab/coloredmatrix-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "61d9a21f1bdff9a2044190b5c3f48e87",
                "sha256": "f2a6007698fe0e0bb0b72fcf09ffc4c92948f3c7a5eca70a83b96231b4ef04d5"
            },
            "downloads": -1,
            "filename": "coloredmatrix-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "61d9a21f1bdff9a2044190b5c3f48e87",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 5761,
            "upload_time": "2023-01-02T13:55:16",
            "upload_time_iso_8601": "2023-01-02T13:55:16.187463Z",
            "url": "https://files.pythonhosted.org/packages/1f/dd/598b27924defe26f32afe5e796e9980753873102e53af39b6fcb00d6b319/coloredmatrix-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-02 13:55:16",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "JewinV",
    "github_project": "coloredmatrix",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "coloredmatrix"
}
        
Elapsed time: 0.07912s