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.1.tar.gz
(383.5 kB
view details)
Built Distribution
x256offline-0.0.1-py3-none-any.whl
(392.8 kB
view details)
File details
Details for the file x256offline-0.0.1.tar.gz
.
File metadata
- Download URL: x256offline-0.0.1.tar.gz
- Upload date:
- Size: 383.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c059b657eaeb2dae934e94460777beeada25d952b82dc35a021069382e20d6 |
|
MD5 | 95336243459b2185c985800566e69dc7 |
|
BLAKE2b-256 | fec9404f73a2ded33d92ecde4afb0753933987b2a83d93d95ab7bcd6cbca2c4e |
File details
Details for the file x256offline-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: x256offline-0.0.1-py3-none-any.whl
- Upload date:
- Size: 392.8 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 | 85d8e9ca97f336815ba21201c07a26678931cc0610ec97a9f780bf960200774d |
|
MD5 | 75aa47ffc5046aaa19da116847b870eb |
|
BLAKE2b-256 | 7859e0b1596a722dbc835a23b8030eb10a08d3468e16f3396100b28e8a7d4635 |