Colors-and-Styles


NameColors-and-Styles JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryA basic package that makes it easy to add color and styles to your terminal.
upload_time2023-04-09 01:54:31
maintainer
docs_urlNone
authorQwertyQwerty
requires_python
licenseMIT
keywords color style ansi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Colors And Styles

A basic package that makes it easy to add color and styles to your terminal.

## How to use
First go to the terminal and run `pip install Colors-and-Styles`. Then create a Python file and paste this code in it:

```python
from ColorsAndStyles import Color, Style, clear, RESET_ALL
```

`clear` is a function that clears and flushes the terminal.

`RESET_ALL` is a string with the ANSI escape code to reset all colors and styles.

### Color
`Color` has 3 classes: `RGB`, `Foreground`, and `Background`.

As a string, an `RGB` value returns an ANSI color code.

- `RGB` requires 4 arguments:

| Parameter      | Description                                                                                                       |
|----------------|-------------------------------------------------------------------------------------------------------------------|
| `red`          | The red value of the RGB.                                                                                         |
| `green`        | The green value of the RGB.                                                                                       |
| `blue`         | The blue value of the RGB.                                                                                        |
| `isForeground` | Returns a foreground ANSI color code as a string if `True`. Else returns a background ANSI color code. (Optional) |

- `Foreground` has 8 class variables: `BLACK`, `RED`, `GREEN`, `YELLOW`, `BLUE`, `MAGENTA`, `CYAN`, and `RESET`. They are assigned to their respective ANSI color codes. To use these color codes, simply concatenate them with a string like so:

```python
print(f"{Color.Foreground.RED}This text is red.{Color.Foreground.RESET}")
```

- `Background` has 9 class variables: `BLACK`, `RED`, `GREEN`, `YELLOW`, `BLUE`, `MAGENTA`, `CYAN`, `WHITE` and `RESET`. To use them, just concatenate them to a string just like `Foreground`'s class variables:

```python
print(f"{Color.Background.GREEN}This text is green.{Color.Background.RESET}")
```

### Style
`Style` has 6 class variables: `BOLD`, `DIM`, `ITALICS`, `UNDERLINE`, `STRIKETHROUGH`, and `RESET`. Like the classes in `Color`, they are assigned to their respective ANSI escape codes. Concatenate them to strings to use them:

```python
print(f"{Style.BOLD}This text is bold.{Style.RESET}")
```


# Change Log

## 1.0.1 (4/8/2023)

- Really really small update that does nothing important

## 1.0.0 (4/8/2023)

- First release

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "Colors-and-Styles",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "color,style,ansi",
    "author": "QwertyQwerty",
    "author_email": "personqwertyperson88@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/72/92/0efa2177f9362212669cf7cab5437d70755c3b6b036dd4014662db8d3527/Colors%20and%20Styles-1.0.1.tar.gz",
    "platform": null,
    "description": "# Colors And Styles\n\nA basic package that makes it easy to add color and styles to your terminal.\n\n## How to use\nFirst go to the terminal and run `pip install Colors-and-Styles`. Then create a Python file and paste this code in it:\n\n```python\nfrom ColorsAndStyles import Color, Style, clear, RESET_ALL\n```\n\n`clear` is a function that clears and flushes the terminal.\n\n`RESET_ALL` is a string with the ANSI escape code to reset all colors and styles.\n\n### Color\n`Color` has 3 classes: `RGB`, `Foreground`, and `Background`.\n\nAs a string, an `RGB` value returns an ANSI color code.\n\n- `RGB` requires 4 arguments:\n\n| Parameter      | Description                                                                                                       |\n|----------------|-------------------------------------------------------------------------------------------------------------------|\n| `red`          | The red value of the RGB.                                                                                         |\n| `green`        | The green value of the RGB.                                                                                       |\n| `blue`         | The blue value of the RGB.                                                                                        |\n| `isForeground` | Returns a foreground ANSI color code as a string if `True`. Else returns a background ANSI color code. (Optional) |\n\n- `Foreground` has 8 class variables: `BLACK`, `RED`, `GREEN`, `YELLOW`, `BLUE`, `MAGENTA`, `CYAN`, and `RESET`. They are assigned to their respective ANSI color codes. To use these color codes, simply concatenate them with a string like so:\n\n```python\nprint(f\"{Color.Foreground.RED}This text is red.{Color.Foreground.RESET}\")\n```\n\n- `Background` has 9 class variables: `BLACK`, `RED`, `GREEN`, `YELLOW`, `BLUE`, `MAGENTA`, `CYAN`, `WHITE` and `RESET`. To use them, just concatenate them to a string just like `Foreground`'s class variables:\n\n```python\nprint(f\"{Color.Background.GREEN}This text is green.{Color.Background.RESET}\")\n```\n\n### Style\n`Style` has 6 class variables: `BOLD`, `DIM`, `ITALICS`, `UNDERLINE`, `STRIKETHROUGH`, and `RESET`. Like the classes in `Color`, they are assigned to their respective ANSI escape codes. Concatenate them to strings to use them:\n\n```python\nprint(f\"{Style.BOLD}This text is bold.{Style.RESET}\")\n```\n\n\n# Change Log\n\n## 1.0.1 (4/8/2023)\n\n- Really really small update that does nothing important\n\n## 1.0.0 (4/8/2023)\n\n- First release\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A basic package that makes it easy to add color and styles to your terminal.",
    "version": "1.0.1",
    "split_keywords": [
        "color",
        "style",
        "ansi"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "72920efa2177f9362212669cf7cab5437d70755c3b6b036dd4014662db8d3527",
                "md5": "1ba53f6a7026671c67363b48166b122b",
                "sha256": "a259b9a4fafa85169e33fb80e76804a5b4ed9dae2e52eeecd30b6ef0d87af8fa"
            },
            "downloads": -1,
            "filename": "Colors and Styles-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1ba53f6a7026671c67363b48166b122b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3843,
            "upload_time": "2023-04-09T01:54:31",
            "upload_time_iso_8601": "2023-04-09T01:54:31.459557Z",
            "url": "https://files.pythonhosted.org/packages/72/92/0efa2177f9362212669cf7cab5437d70755c3b6b036dd4014662db8d3527/Colors%20and%20Styles-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-09 01:54:31",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "colors-and-styles"
}
        
Elapsed time: 0.67512s