Skip to main content

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 hashes)

Uploaded Source

Built Distribution

x256offline-0.0.4-py3-none-any.whl (284.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page