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.3.tar.gz
(284.8 kB
view hashes)
Built Distribution
x256offline-0.0.3-py3-none-any.whl
(284.9 kB
view hashes)
Close
Hashes for x256offline-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5957ae444ce8792d597dc3dd42e52da202d21f5a355f43748022ab0f22623cb7 |
|
MD5 | 23af208b065623bf3909c120f7c0af29 |
|
BLAKE2b-256 | 4901523fa36a7c646e14f554c274e95a4fda5bc0ad994abc349b9e19bd1c95f9 |