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.4.tar.gz
(284.7 kB
view details)
Built Distribution
x256offline-0.0.4-py3-none-any.whl
(284.8 kB
view details)
File details
Details for the file x256offline-0.0.4.tar.gz
.
File metadata
- Download URL: x256offline-0.0.4.tar.gz
- Upload date:
- Size: 284.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d76470b20bf4773677bd9c44120d8979df577ea744bf0ba7eeb74308ac4c7e0 |
|
MD5 | 4b3a535ed255085ab95b54ac18ec1eac |
|
BLAKE2b-256 | 497e3e5e438f02bb4d6c221abafc771a5debc8df42280ad7153980fbb9420f90 |
File details
Details for the file x256offline-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: x256offline-0.0.4-py3-none-any.whl
- Upload date:
- Size: 284.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 | 267481808aa884e771a7f4530d00063ae38ff018d11d9b50aaef3476f8a5c570 |
|
MD5 | 9794e6ee61cdbbbf14ced54dffd38111 |
|
BLAKE2b-256 | e16384b0af8337a68ee2a0ecce0d28686d696f91369c3beba006c5a921e1b3c0 |