polychromy


Namepolychromy JSON
Version 1.1.0 PyPI version JSON
download
home_pageNone
SummaryA module to print a strings in a given colour, with a given colour background
upload_time2024-04-10 14:41:40
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT License
keywords ansi background color colour colorate font format foreground hex paint rgb srgb text
VCS
bugtrack_url
requirements requests textlinebreaker
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Polychromy

[<img src="https://img.shields.io/badge/polychromy-py-blue?style=flat&logo=python&logoWidth=20.svg/"></a>](https://github.com/scalvaruso/polychromy/)
[![PyPI - Version](https://img.shields.io/pypi/v/polychromy?logo=pypi&logoColor=white&color=blue)](https://pypi.org/project/polychromy/)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/polychromy?logo=python)](https://pypi.org/project/polychromy/)
[![Downloads](https://static.pepy.tech/badge/polychromy)](https://pepy.tech/project/polychromy)
[![PyPI - License](https://img.shields.io/pypi/l/polychromy?color=blue)](https://github.com/scalvaruso/polychromy/blob/main/LICENSE.md)

<!---
[![PyPI - status](https://img.shields.io/pypi/status/:polychromy)](https://pypi.org/project/polychromy/)
[![Documentation Status](https://readthedocs.org/projects/polychromy/badge/?version=latest)](https://polychromy.readthedocs.io/en/latest/?badge=latest)
-->

## Description

Polychromy is a Python script to manipulate the colors of a text.

## Features

- Function ```colorate``` prints text of a specified colour in a specified colour background.
- Function ```show``` prints out color details such as Hex and RGB values of a given colour in a square of the given colour.

## Latest Version 1.1.0

## Table of Contents

- [Getting Started](#getting-started)
  - [Prerequisites](#prerequisites)
  - [Installation](#installation)
- [Usage](#usage)
  - [Parameters](#parameters)
  - [Examples](#examples)
- [Contributing](#contributing)
- [License](#license)

## Getting Started

### Prerequisites

This script relies on the Python standard library, and the libraries ```requests``` and ```textlinebreaker```.

### Installation

- Install the package with pip

```bash
  pip install polychromy
```

- Import the selected package in your program

```Python
  from polychromy import colorate
```

or

```Python
  from polychromy import show
```

## Usage

Calling the function ```show``` your program will print a square of the selected color with details about it.
Calling the function ```colorate``` inside your program will return a printable string of the desired color.

### Parameters

The function accept most color names, RGB values ```[0-255];[0-255];[0-255]```, Hex values ```#[00-FF][00-FF][00-FF]```, xterm color number in the format ```x[0-255]```, and ANSI codes.[^Note]

[^Note]: The output color might differ from the desired one depending on terminal used.

### Examples

Here are some examples of how to use polychromy.

<!--- Example 01 --->
#### Show

Using the function ```show``` you can print out color details such as Hex and RGB values of a given colour in a square of the given colour.

```Python
import sys
from polychromy import show

# If you run this program without any argument it asks you for a color and prints it out to the screen.
if len(sys.argv) == 1:

    color_in = input("Enter a colour: ")
    show(color_in)

# Giving a color as argument it prints it out directly to the screen
# Accepted values are: Name colors, HEX and RGB values.

else:
    show()

```

##### Output 1

![example01](https://raw.githubusercontent.com/scalvaruso/polychromy/main/images/example01.png)

<!--- Example 02 --->
#### Colorate

Using the function ```colorate``` you can print text of a specified colour in a specified colour background.

```Python
from polychromy import colorate

# Texts to print
text1 = "There are only 10 kinds of people in this world:"
text2 = "Those who know binary and Those who don't."

# Foreground (text) coors
foreground_1 = "#F5F5F5"
foreground_2 = 90

# Background colors
background_1 = "0;128;128"
background_2 = "Cosmic Latte"

print(colorate(text1,foreground_1,background_1))
print(colorate(text2,foreground_2,background_2))

```

##### Output 2

![example02](https://raw.githubusercontent.com/scalvaruso/polychromy/main/images/example02.png)

## Contributing

If you'd like to contribute to this project, please follow these steps:

1. Fork the repository on GitHub.
2. Clone the fork to your local machine.
3. Create a new branch for your feature or bug fix.
4. Make your changes and commit them.
5. Push the changes to your fork on GitHub.
6. Create a pull request to the original repository.

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/scalvaruso/polychromy/blob/main/LICENSE.md) file for details.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "polychromy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "ansi, background, color, colour, colorate, font, format, foreground, Hex, paint, RGB, sRGB, text",
    "author": null,
    "author_email": "scalvaruso <calvaruso.simone@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/68/2c/0b5da5b733c0e376b9c55ded00428071cf62f14e49fb421ea65318d9111e/polychromy-1.1.0.tar.gz",
    "platform": null,
    "description": "# Polychromy\n\n[<img src=\"https://img.shields.io/badge/polychromy-py-blue?style=flat&logo=python&logoWidth=20.svg/\"></a>](https://github.com/scalvaruso/polychromy/)\n[![PyPI - Version](https://img.shields.io/pypi/v/polychromy?logo=pypi&logoColor=white&color=blue)](https://pypi.org/project/polychromy/)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/polychromy?logo=python)](https://pypi.org/project/polychromy/)\n[![Downloads](https://static.pepy.tech/badge/polychromy)](https://pepy.tech/project/polychromy)\n[![PyPI - License](https://img.shields.io/pypi/l/polychromy?color=blue)](https://github.com/scalvaruso/polychromy/blob/main/LICENSE.md)\n\n<!---\n[![PyPI - status](https://img.shields.io/pypi/status/:polychromy)](https://pypi.org/project/polychromy/)\n[![Documentation Status](https://readthedocs.org/projects/polychromy/badge/?version=latest)](https://polychromy.readthedocs.io/en/latest/?badge=latest)\n-->\n\n## Description\n\nPolychromy is a Python script to manipulate the colors of a text.\n\n## Features\n\n- Function ```colorate``` prints text of a specified colour in a specified colour background.\n- Function ```show``` prints out color details such as Hex and RGB values of a given colour in a square of the given colour.\n\n## Latest Version 1.1.0\n\n## Table of Contents\n\n- [Getting Started](#getting-started)\n  - [Prerequisites](#prerequisites)\n  - [Installation](#installation)\n- [Usage](#usage)\n  - [Parameters](#parameters)\n  - [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Getting Started\n\n### Prerequisites\n\nThis script relies on the Python standard library, and the libraries ```requests``` and ```textlinebreaker```.\n\n### Installation\n\n- Install the package with pip\n\n```bash\n  pip install polychromy\n```\n\n- Import the selected package in your program\n\n```Python\n  from polychromy import colorate\n```\n\nor\n\n```Python\n  from polychromy import show\n```\n\n## Usage\n\nCalling the function ```show``` your program will print a square of the selected color with details about it.\nCalling the function ```colorate``` inside your program will return a printable string of the desired color.\n\n### Parameters\n\nThe function accept most color names, RGB values ```[0-255];[0-255];[0-255]```, Hex values ```#[00-FF][00-FF][00-FF]```, xterm color number in the format ```x[0-255]```, and ANSI codes.[^Note]\n\n[^Note]: The output color might differ from the desired one depending on terminal used.\n\n### Examples\n\nHere are some examples of how to use polychromy.\n\n<!--- Example 01 --->\n#### Show\n\nUsing the function ```show``` you can print out color details such as Hex and RGB values of a given colour in a square of the given colour.\n\n```Python\nimport sys\nfrom polychromy import show\n\n# If you run this program without any argument it asks you for a color and prints it out to the screen.\nif len(sys.argv) == 1:\n\n    color_in = input(\"Enter a colour: \")\n    show(color_in)\n\n# Giving a color as argument it prints it out directly to the screen\n# Accepted values are: Name colors, HEX and RGB values.\n\nelse:\n    show()\n\n```\n\n##### Output 1\n\n![example01](https://raw.githubusercontent.com/scalvaruso/polychromy/main/images/example01.png)\n\n<!--- Example 02 --->\n#### Colorate\n\nUsing the function ```colorate``` you can print text of a specified colour in a specified colour background.\n\n```Python\nfrom polychromy import colorate\n\n# Texts to print\ntext1 = \"There are only 10 kinds of people in this world:\"\ntext2 = \"Those who know binary and Those who don't.\"\n\n# Foreground (text) coors\nforeground_1 = \"#F5F5F5\"\nforeground_2 = 90\n\n# Background colors\nbackground_1 = \"0;128;128\"\nbackground_2 = \"Cosmic Latte\"\n\nprint(colorate(text1,foreground_1,background_1))\nprint(colorate(text2,foreground_2,background_2))\n\n```\n\n##### Output 2\n\n![example02](https://raw.githubusercontent.com/scalvaruso/polychromy/main/images/example02.png)\n\n## Contributing\n\nIf you'd like to contribute to this project, please follow these steps:\n\n1. Fork the repository on GitHub.\n2. Clone the fork to your local machine.\n3. Create a new branch for your feature or bug fix.\n4. Make your changes and commit them.\n5. Push the changes to your fork on GitHub.\n6. Create a pull request to the original repository.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/scalvaruso/polychromy/blob/main/LICENSE.md) file for details.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "A module to print a strings in a given colour, with a given colour background",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "https://pypi.org/project/polychromy",
        "Repository": "https://github.com/scalvaruso/polychromy"
    },
    "split_keywords": [
        "ansi",
        " background",
        " color",
        " colour",
        " colorate",
        " font",
        " format",
        " foreground",
        " hex",
        " paint",
        " rgb",
        " srgb",
        " text"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5b37ab22b1eed146a47238e3aa5f13f3d14657e8e2a94b981eb42a7cb72a0253",
                "md5": "0278dda8491e3f87c2bac94c939f937a",
                "sha256": "b1592d157f9ccddbf622bccabc768139e6f791a01d94c6ccb22d6bd0d4b5b967"
            },
            "downloads": -1,
            "filename": "polychromy-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0278dda8491e3f87c2bac94c939f937a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 14223,
            "upload_time": "2024-04-10T14:41:37",
            "upload_time_iso_8601": "2024-04-10T14:41:37.291468Z",
            "url": "https://files.pythonhosted.org/packages/5b/37/ab22b1eed146a47238e3aa5f13f3d14657e8e2a94b981eb42a7cb72a0253/polychromy-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "682c0b5da5b733c0e376b9c55ded00428071cf62f14e49fb421ea65318d9111e",
                "md5": "f1e0ef58945b96cb783e0bdb33e9a01a",
                "sha256": "122c45fd6a758f6d418ee581330366616d8cdfbfec5b52b902d6770a1b5aaf58"
            },
            "downloads": -1,
            "filename": "polychromy-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "f1e0ef58945b96cb783e0bdb33e9a01a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 16363,
            "upload_time": "2024-04-10T14:41:40",
            "upload_time_iso_8601": "2024-04-10T14:41:40.284468Z",
            "url": "https://files.pythonhosted.org/packages/68/2c/0b5da5b733c0e376b9c55ded00428071cf62f14e49fb421ea65318d9111e/polychromy-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-10 14:41:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "scalvaruso",
    "github_project": "polychromy",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "requests",
            "specs": []
        },
        {
            "name": "textlinebreaker",
            "specs": [
                [
                    ">=",
                    "0.1.0"
                ]
            ]
        }
    ],
    "lcname": "polychromy"
}
        
Elapsed time: 0.23374s