quickly find the nearest xterm 256 color index of an RGB
Project description
Quickly find the nearest xterm 256 color index of an RGB.
Installation
python -m pip install x256offline
Simple Example
import x256offline as x256
c0 = 0x23307b
x0e = x256.from_rgb(c0)
x0w = x256.from_rgb(c0, weighted=True)
print(hex(c0))
print(x0e, hex(x256.to_rgb(x0e)))
print(x0w, hex(x256.to_rgb(x0w)))
# 0x23307b
# 4 0x80
# 24 0x5f87
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
x256offline-0.0.2.tar.gz
(383.8 kB
view details)
Built Distribution
x256offline-0.0.2-py3-none-any.whl
(392.7 kB
view details)
File details
Details for the file x256offline-0.0.2.tar.gz
.
File metadata
- Download URL: x256offline-0.0.2.tar.gz
- Upload date:
- Size: 383.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e50738c1e6b82d1630f49bd6f737c1dcbe6bc826a9364af4a943c5b42a0c9a02 |
|
MD5 | 7ef07f173426571aa40a23114a0c1b54 |
|
BLAKE2b-256 | dbc4949a93919762f4951100b2e6d6ff903f09a936f4e78eda4ff86c5f8e41a7 |
File details
Details for the file x256offline-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: x256offline-0.0.2-py3-none-any.whl
- Upload date:
- Size: 392.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b741ac1672e694d45ff41e6da48baacbcb3428d06fcb81abadd521842ee7f814 |
|
MD5 | 4741e0c32d42fcf49328cffdb6283ff9 |
|
BLAKE2b-256 | f00d7c536e05d9f70bcd6ee3124d4cb1b2d23b5bc4df44f130843bf32dcf21c5 |