ColorFlow


NameColorFlow JSON
Version 2.0.0 PyPI version JSON
download
home_pageNone
SummaryA Python library for creating and applying full-color, linear, and circular gradients to text with easy color management.
upload_time2024-12-07 21:47:26
maintainerNone
docs_urlNone
authorPcoi94
requires_python>=3.6
licenseMIT
keywords python color flow easy cmd app manage text colour ansi terminal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ColorFlow

A Python library for creating stunning color gradients, including full-color, and applying them to text. It supports both linear and circular gradients with comprehensive color management tools.

## Installation

Install ColorFlow using pip:

```bash
pip install colorflow
```

## Color Layers

ColorFlow introduces flexible color layer control, allowing developers to apply colors to text with precision. Developers can choose to color the foreground text, background, or both simultaneously.

```python
from colorflow import Presets, ColorLayer

blue = Presets.Blue

# Foreground coloration (default behavior)
print(blue("Blue Text", layer=ColorLayer.FOREGROUND))

# Background coloration
print(blue("Blue Background", layer=ColorLayer.BACKGROUND))

# Comprehensive color application
print(blue("Blue Everywhere", layer=ColorLayer.BOTH))
```

## Color Creation Methods

The library supports multiple color generation techniques, enabling developers to create colors through various input formats.

```python
from colorflow import FromRGB, FromHTML, FromHSL

# RGB color generation
custom_blue = FromRGB(0, 0, 255)

# HTML hex code parsing
web_red = FromHTML("#FF0000")

# HSL color conversion
pastel_green = FromHSL(120, 0.5, 0.6)

# Maybe i'll had more conversions.
```

## Color Presets

ColorFlow provides a comprehensive collection of predefined colors, simplifying color selection for developers.

```python
from colorflow import Presets

blue = Presets.Blue
red = Presets.Red
green = Presets.Green
```

## Gradient Generation

The library supports both linear and radial color gradients, enabling sophisticated text color transitions.

### Linear Gradient

```python
from colorflow import ColorSequence, Presets, GradientType, ColorLayer

gradient = ColorSequence({
    0: Presets.Blue, 
    1: Presets.Red
}, gradient_type=GradientType.LINEAR)

print(gradient("Smooth color transition", layer=ColorLayer.FOREGROUND))
```

### Radial Gradient

```python
angular_gradient = ColorSequence({
    0: Presets.Blue,
    0.5: Presets.White,
    1: Presets.Red
}, gradient_type=GradientType.RADIAL)

print(angular_gradient("Radial color spread", layer=ColorLayer.FOREGROUND))
```

## Advanced Color Mapping

Developers can create complex color mappings, assigning unique colors to individual characters.

```python
from colorflow import MapCharsToColors, Presets, ColorLayer

mapper = MapCharsToColors({
    'h': Presets.Red,
    'e': Presets.Green,
    'l': Presets.Blue,
    'o': Presets.Purple
}, layer=ColorLayer.BOTH)

print(mapper("hello"))
```

## Random Color Generation

ColorFlow offers random color generation with optional color palette constraints.

```python
from colorflow import RandomColor, Presets

random_color = RandomColor()  # Completely random
specific_colors = RandomColor([Presets.Red, Presets.Green, Presets.Blue])
```

## Coordinate System

Gradient coordinates are normalized between `(0, 0)` and `(1, 1)`:
- `(0, 0)` represents the top-left corner
- `(1, 1)` represents the bottom-right corner
- `(0.5, 0.5)` indicates the center point

## License

Distributed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "ColorFlow",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "python, color, flow, easy, cmd, app, manage, text, colour, ansi, terminal",
    "author": "Pcoi94",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/64/ca/7e8e209eaf782703c00407ad0fec6711307f6f2ee5d0ec45ea7bf07b9736/colorflow-2.0.0.tar.gz",
    "platform": null,
    "description": "# ColorFlow\n\nA Python library for creating stunning color gradients, including full-color, and applying them to text. It supports both linear and circular gradients with comprehensive color management tools.\n\n## Installation\n\nInstall ColorFlow using pip:\n\n```bash\npip install colorflow\n```\n\n## Color Layers\n\nColorFlow introduces flexible color layer control, allowing developers to apply colors to text with precision. Developers can choose to color the foreground text, background, or both simultaneously.\n\n```python\nfrom colorflow import Presets, ColorLayer\n\nblue = Presets.Blue\n\n# Foreground coloration (default behavior)\nprint(blue(\"Blue Text\", layer=ColorLayer.FOREGROUND))\n\n# Background coloration\nprint(blue(\"Blue Background\", layer=ColorLayer.BACKGROUND))\n\n# Comprehensive color application\nprint(blue(\"Blue Everywhere\", layer=ColorLayer.BOTH))\n```\n\n## Color Creation Methods\n\nThe library supports multiple color generation techniques, enabling developers to create colors through various input formats.\n\n```python\nfrom colorflow import FromRGB, FromHTML, FromHSL\n\n# RGB color generation\ncustom_blue = FromRGB(0, 0, 255)\n\n# HTML hex code parsing\nweb_red = FromHTML(\"#FF0000\")\n\n# HSL color conversion\npastel_green = FromHSL(120, 0.5, 0.6)\n\n# Maybe i'll had more conversions.\n```\n\n## Color Presets\n\nColorFlow provides a comprehensive collection of predefined colors, simplifying color selection for developers.\n\n```python\nfrom colorflow import Presets\n\nblue = Presets.Blue\nred = Presets.Red\ngreen = Presets.Green\n```\n\n## Gradient Generation\n\nThe library supports both linear and radial color gradients, enabling sophisticated text color transitions.\n\n### Linear Gradient\n\n```python\nfrom colorflow import ColorSequence, Presets, GradientType, ColorLayer\n\ngradient = ColorSequence({\n    0: Presets.Blue, \n    1: Presets.Red\n}, gradient_type=GradientType.LINEAR)\n\nprint(gradient(\"Smooth color transition\", layer=ColorLayer.FOREGROUND))\n```\n\n### Radial Gradient\n\n```python\nangular_gradient = ColorSequence({\n    0: Presets.Blue,\n    0.5: Presets.White,\n    1: Presets.Red\n}, gradient_type=GradientType.RADIAL)\n\nprint(angular_gradient(\"Radial color spread\", layer=ColorLayer.FOREGROUND))\n```\n\n## Advanced Color Mapping\n\nDevelopers can create complex color mappings, assigning unique colors to individual characters.\n\n```python\nfrom colorflow import MapCharsToColors, Presets, ColorLayer\n\nmapper = MapCharsToColors({\n    'h': Presets.Red,\n    'e': Presets.Green,\n    'l': Presets.Blue,\n    'o': Presets.Purple\n}, layer=ColorLayer.BOTH)\n\nprint(mapper(\"hello\"))\n```\n\n## Random Color Generation\n\nColorFlow offers random color generation with optional color palette constraints.\n\n```python\nfrom colorflow import RandomColor, Presets\n\nrandom_color = RandomColor()  # Completely random\nspecific_colors = RandomColor([Presets.Red, Presets.Green, Presets.Blue])\n```\n\n## Coordinate System\n\nGradient coordinates are normalized between `(0, 0)` and `(1, 1)`:\n- `(0, 0)` represents the top-left corner\n- `(1, 1)` represents the bottom-right corner\n- `(0.5, 0.5)` indicates the center point\n\n## License\n\nDistributed under the MIT License.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python library for creating and applying full-color, linear, and circular gradients to text with easy color management.",
    "version": "2.0.0",
    "project_urls": null,
    "split_keywords": [
        "python",
        " color",
        " flow",
        " easy",
        " cmd",
        " app",
        " manage",
        " text",
        " colour",
        " ansi",
        " terminal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "915d073526e1f214e0cd2656af81f74520a0e9d46820a5e22817e464ef99509f",
                "md5": "45102065d0f1b09d1ee541d6e120038e",
                "sha256": "531430016bd020ce2f5d278dae3d18b526af3db8370125d47f817cc8bbdf608b"
            },
            "downloads": -1,
            "filename": "colorflow-2.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "45102065d0f1b09d1ee541d6e120038e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 8023,
            "upload_time": "2024-12-07T21:47:24",
            "upload_time_iso_8601": "2024-12-07T21:47:24.915260Z",
            "url": "https://files.pythonhosted.org/packages/91/5d/073526e1f214e0cd2656af81f74520a0e9d46820a5e22817e464ef99509f/colorflow-2.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "64ca7e8e209eaf782703c00407ad0fec6711307f6f2ee5d0ec45ea7bf07b9736",
                "md5": "4859a9d43cc3e40102360a9e907c2cc1",
                "sha256": "a1584ffbac7c0326ac490accf0ef83f0c482bb1ab2357edaeee831d467572781"
            },
            "downloads": -1,
            "filename": "colorflow-2.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4859a9d43cc3e40102360a9e907c2cc1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 16767,
            "upload_time": "2024-12-07T21:47:26",
            "upload_time_iso_8601": "2024-12-07T21:47:26.862091Z",
            "url": "https://files.pythonhosted.org/packages/64/ca/7e8e209eaf782703c00407ad0fec6711307f6f2ee5d0ec45ea7bf07b9736/colorflow-2.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-07 21:47:26",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "colorflow"
}
        
Elapsed time: 0.36886s