[![Build Status](https://github.com/hsluv/hsluv-python/actions/workflows/test.yml/badge.svg)](https://github.com/hsluv/hsluv-python/actions/workflows/test.yml)
[![Package Version](https://img.shields.io/pypi/v/hsluv.svg)](https://pypi.python.org/pypi/hsluv/)
A Python implementation of [HSLuv](https://www.hsluv.org) (revision 4).
## Installation
`pip install hsluv`
Python 2 users: `pip install hsluv==5.0.0`
## Usage
> This library does not hide (clamp) floating point error, e.g. you might receive a value outside
> of the expected range. If you wish to display the outputs of this library, consider rounding them
> for your purpose. The floating point error has not been quantified, but at least 10 decimal digits
> should be free of it.
### `hsluv_to_hex([hue, saturation, lightness])`
`hue` is a float between 0 and 360, `saturation` and `lightness` are floats between 0 and 100. This
function returns the resulting color as a hex string.
### `hsluv_to_rgb([hue, saturation, lightness])`
Like above, but returns a list of 3 floats between 0 and 1, for each RGB channel.
### `hex_to_hsluv(hex)`
Takes a hex string and returns the HSLuv color as a list of floats as defined above.
### `rgb_to_hsluv([red, green, blue])`
Like above, but `red`, `green` and `blue` are passed as floats between 0 and 1.
For HPLuv (the pastel variant), use `hpluv_to_hex`, `hpluv_to_rgb`, `hex_to_hpluv` and `rgb_to_hpluv`.
## Testing
Run `python setup.py test`.
## Authors
* Robert McGinley ([mcginleyr1](https://github.com/mcginleyr1))
* Alexei Boronine ([boronine](https://github.com/boronine))
Raw data
{
"_id": null,
"home_page": "https://www.hsluv.org",
"name": "hsluv",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "color hsl cie cieluv colorwheel hsluv hpluv",
"author": "",
"author_email": "alexei@boronine.com",
"download_url": "https://files.pythonhosted.org/packages/ac/81/af16607fa045724e515579d312577261b436f36f419e7c677e7e88fcc943/hsluv-5.0.4.tar.gz",
"platform": null,
"description": "[![Build Status](https://github.com/hsluv/hsluv-python/actions/workflows/test.yml/badge.svg)](https://github.com/hsluv/hsluv-python/actions/workflows/test.yml)\n[![Package Version](https://img.shields.io/pypi/v/hsluv.svg)](https://pypi.python.org/pypi/hsluv/)\n\nA Python implementation of [HSLuv](https://www.hsluv.org) (revision 4).\n\n## Installation\n\n`pip install hsluv`\n\nPython 2 users: `pip install hsluv==5.0.0`\n\n## Usage\n\n> This library does not hide (clamp) floating point error, e.g. you might receive a value outside\n> of the expected range. If you wish to display the outputs of this library, consider rounding them \n> for your purpose. The floating point error has not been quantified, but at least 10 decimal digits \n> should be free of it.\n\n### `hsluv_to_hex([hue, saturation, lightness])`\n\n`hue` is a float between 0 and 360, `saturation` and `lightness` are floats between 0 and 100. This \nfunction returns the resulting color as a hex string.\n\n### `hsluv_to_rgb([hue, saturation, lightness])`\n\nLike above, but returns a list of 3 floats between 0 and 1, for each RGB channel.\n\n### `hex_to_hsluv(hex)`\n\nTakes a hex string and returns the HSLuv color as a list of floats as defined above.\n\n### `rgb_to_hsluv([red, green, blue])`\n\nLike above, but `red`, `green` and `blue` are passed as floats between 0 and 1.\n\nFor HPLuv (the pastel variant), use `hpluv_to_hex`, `hpluv_to_rgb`, `hex_to_hpluv` and `rgb_to_hpluv`.\n\n## Testing\n\nRun `python setup.py test`.\n\n## Authors\n\n* Robert McGinley ([mcginleyr1](https://github.com/mcginleyr1))\n* Alexei Boronine ([boronine](https://github.com/boronine))\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Human-friendly HSL",
"version": "5.0.4",
"project_urls": {
"Bug Tracker": "https://github.com/hsluv/hsluv-python/issues",
"Homepage": "https://www.hsluv.org",
"Source Code": "https://github.com/hsluv/hsluv-python"
},
"split_keywords": [
"color",
"hsl",
"cie",
"cieluv",
"colorwheel",
"hsluv",
"hpluv"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "96365bddefea3d7adf22a64f9aa9701492f8a9fe6948223f5cf2602c22ec9be7",
"md5": "07be5180a93fa0157a6870d8c4f2ee76",
"sha256": "0138bd10038e2ee1b13eecae9a7d49d4ec8c320b1d7eb4f860832c792e3e4567"
},
"downloads": -1,
"filename": "hsluv-5.0.4-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "07be5180a93fa0157a6870d8c4f2ee76",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 5252,
"upload_time": "2023-09-11T21:46:50",
"upload_time_iso_8601": "2023-09-11T21:46:50.407676Z",
"url": "https://files.pythonhosted.org/packages/96/36/5bddefea3d7adf22a64f9aa9701492f8a9fe6948223f5cf2602c22ec9be7/hsluv-5.0.4-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac81af16607fa045724e515579d312577261b436f36f419e7c677e7e88fcc943",
"md5": "f5abffe2479ddeb19bb3ef1033464264",
"sha256": "2281f946427a882010042844a38c7bbe9e0d0aaf9d46babe46366ed6f169b72e"
},
"downloads": -1,
"filename": "hsluv-5.0.4.tar.gz",
"has_sig": false,
"md5_digest": "f5abffe2479ddeb19bb3ef1033464264",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 543090,
"upload_time": "2023-09-11T21:46:52",
"upload_time_iso_8601": "2023-09-11T21:46:52.022853Z",
"url": "https://files.pythonhosted.org/packages/ac/81/af16607fa045724e515579d312577261b436f36f419e7c677e7e88fcc943/hsluv-5.0.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-09-11 21:46:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hsluv",
"github_project": "hsluv-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "hsluv"
}