Skip to main content

python-x256-numpy

Quickly find the nearest xterm 256 color index of an RGB.

NumPy version of python-x256-offline.

Installation

python -m pip install x256numpy

Simple Example

import x256numpy as x256

c0 = 0x297331
b, g, r = c0 & 0xff, (c0 >> 8) & 0xff, (c0 >> 16) & 0xff
x0e = x256.from_rgb(r, g, b, weighted=False, n_color=232)
x0w = x256.from_rgb(r, g, b, weighted=True, n_color=232)
x1e = x256.from_rgb(r, g, b, weighted=False, n_color=256)
x1w = x256.from_rgb(r, g, b, weighted=True, n_color=256)

print('%06x %d %06x %d %06x %d %06x %d %06x' % (
    c0,
    x0e, x256.to_rgb(x0e),
    x0w, x256.to_rgb(x0w),
    x1e, x256.to_rgb(x1e),
    x1w, x256.to_rgb(x1w)
))
# 297331 23 005f5f 2 008000 238 444444 239 4e4e4e

Metadata

Release files for x256numpy 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for x256numpy 0.0.1
File Size Uploaded Provenance Actions
x256numpy-0.0.1.tar.gz 262.3 kB Without provenance Details for x256numpy-0.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for x256numpy 0.0.1
File Interpreter ABI Platform Actions
x256numpy-0.0.1-py3-none-any.whl Python 3 none any Details for x256numpy-0.0.1-py3-none-any.whl

Total release size: 524.1 kB

Release files / x256numpy-0.0.1.tar.gz

Download URL x256numpy-0.0.1.tar.gz
Size 262.3 kB
Tags Source
SHA-256 checksum
How to use checksums
33e62dc262049fb5b8ec82652f1d7f01b21535e6ef41b3bc41170fc1a317b4c0
BLAKE2b-256 checksum
How to use checksums
f4f4cdde4ee69f62529999d15dd80e8a8964908152e98debeb9468b75cd38749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Release files / x256numpy-0.0.1-py3-none-any.whl

Download URL x256numpy-0.0.1-py3-none-any.whl
Size 261.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
41c975c4c2d7e24d93a7bac8b0f63ab1755c059e6abfd827ed3e535aff143bdc
BLAKE2b-256 checksum
How to use checksums
156f7727dd8f7048abbb7663381443a4182c9dfb6c991dd1fb6c5054860f5131
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.7

Security for x256numpy 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page