Name | x256numpy JSON |
Version |
0.0.1
JSON |
| download |
home_page | None |
Summary | Quickly find the nearest xterm 256 color index of an RGB (NumPy Version) |
upload_time | 2025-01-16 15:41:25 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License Copyright (c) 2024 Elaina Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
x256
xterm
color
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
python-x256-numpy
=================
Quickly find the nearest xterm 256 color index of an RGB.
NumPy version of
`python-x256-offline <https://pypi.org/project/x256offline/>`__.
Installation
------------
.. code:: shell
python -m pip install x256numpy
Simple Example
--------------
.. code:: python
import x256numpy as x256
c0 = 0x297331
b, g, r = c0 & 0xff, (c0 >> 8) & 0xff, (c0 >> 16) & 0xff
x0e = x256.from_rgb(r, g, b, weighted=False, n_color=232)
x0w = x256.from_rgb(r, g, b, weighted=True, n_color=232)
x1e = x256.from_rgb(r, g, b, weighted=False, n_color=256)
x1w = x256.from_rgb(r, g, b, weighted=True, n_color=256)
print('%06x %d %06x %d %06x %d %06x %d %06x' % (
c0,
x0e, x256.to_rgb(x0e),
x0w, x256.to_rgb(x0w),
x1e, x256.to_rgb(x1e),
x1w, x256.to_rgb(x1w)
))
# 297331 23 005f5f 2 008000 238 444444 239 4e4e4e
Raw data
{
"_id": null,
"home_page": null,
"name": "x256numpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "userElaina <userelaina@pm.me>",
"keywords": "x256, xterm, color",
"author": null,
"author_email": "userElaina <userelaina@pm.me>",
"download_url": "https://files.pythonhosted.org/packages/f4/f4/cdde4ee69f62529999d15dd80e8a8964908152e98debeb9468b75cd38749/x256numpy-0.0.1.tar.gz",
"platform": null,
"description": "python-x256-numpy\n=================\n\nQuickly find the nearest xterm 256 color index of an RGB.\n\nNumPy version of\n`python-x256-offline <https://pypi.org/project/x256offline/>`__.\n\nInstallation\n------------\n\n.. code:: shell\n\n python -m pip install x256numpy\n\nSimple Example\n--------------\n\n.. code:: python\n\n import x256numpy as x256\n\n c0 = 0x297331\n b, g, r = c0 & 0xff, (c0 >> 8) & 0xff, (c0 >> 16) & 0xff\n x0e = x256.from_rgb(r, g, b, weighted=False, n_color=232)\n x0w = x256.from_rgb(r, g, b, weighted=True, n_color=232)\n x1e = x256.from_rgb(r, g, b, weighted=False, n_color=256)\n x1w = x256.from_rgb(r, g, b, weighted=True, n_color=256)\n\n print('%06x %d %06x %d %06x %d %06x %d %06x' % (\n c0,\n x0e, x256.to_rgb(x0e),\n x0w, x256.to_rgb(x0w),\n x1e, x256.to_rgb(x1e),\n x1w, x256.to_rgb(x1w)\n ))\n # 297331 23 005f5f 2 008000 238 444444 239 4e4e4e\n",
"bugtrack_url": null,
"license": "MIT License Copyright (c) 2024 Elaina Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
"summary": "Quickly find the nearest xterm 256 color index of an RGB (NumPy Version)",
"version": "0.0.1",
"project_urls": {
"Bug Reports": "https://github.com/userElaina/python-x256-numpy/issues",
"Homepage": "https://github.com/userElaina/python-x256-numpy",
"Source": "https://github.com/userElaina/python-x256-numpy"
},
"split_keywords": [
"x256",
" xterm",
" color"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "156f7727dd8f7048abbb7663381443a4182c9dfb6c991dd1fb6c5054860f5131",
"md5": "dfb4b89fa8fd903b57f256efce0f3750",
"sha256": "41c975c4c2d7e24d93a7bac8b0f63ab1755c059e6abfd827ed3e535aff143bdc"
},
"downloads": -1,
"filename": "x256numpy-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "dfb4b89fa8fd903b57f256efce0f3750",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 261780,
"upload_time": "2025-01-16T15:41:22",
"upload_time_iso_8601": "2025-01-16T15:41:22.076056Z",
"url": "https://files.pythonhosted.org/packages/15/6f/7727dd8f7048abbb7663381443a4182c9dfb6c991dd1fb6c5054860f5131/x256numpy-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f4f4cdde4ee69f62529999d15dd80e8a8964908152e98debeb9468b75cd38749",
"md5": "efeebe2ca712d5d38c23a9fdcf339324",
"sha256": "33e62dc262049fb5b8ec82652f1d7f01b21535e6ef41b3bc41170fc1a317b4c0"
},
"downloads": -1,
"filename": "x256numpy-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "efeebe2ca712d5d38c23a9fdcf339324",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 262310,
"upload_time": "2025-01-16T15:41:25",
"upload_time_iso_8601": "2025-01-16T15:41:25.612015Z",
"url": "https://files.pythonhosted.org/packages/f4/f4/cdde4ee69f62529999d15dd80e8a8964908152e98debeb9468b75cd38749/x256numpy-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-16 15:41:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "userElaina",
"github_project": "python-x256-numpy",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "x256numpy"
}