Skip to main content

RGB2HEX

A simple Python library for converting between Hexadecimal and RGB color formats.

Features

  • Convert Hex color codes to RGB format.
  • Convert RGB format back to Hex color codes.

Installation

To install the library via pip:

pip install rgb2hex

Convert Hex to RGB

You can convert a hexadecimal color code to an RGB tuple like this:

from rgb2hex import hex2rgb

# Example usage
hex_code = "#ff5733"
rgb = hex2rgb(hex_code)
print(rgb)  # Output: (255, 87, 51)

Convert RGB to Hex

You can convert an RGB list to a hexadecimal color code:

from rgb2hex import rgb2hex

# Example usage
rgb = [255, 87, 51]
hex_code = rgb2hex(rgb)
print(hex_code)  # Output: #ff5733

Contributing

Feel free to open issues or submit pull requests if you'd like to contribute.

License

This project is licensed under the MIT License.

Release files for rgb2hex 0.1.0

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

Source distribution (sdist)

Source distribution for rgb2hex 0.1.0
File Size Uploaded
rgb2hex-0.1.0.tar.gz 2.8 kB Details

Built distribution (wheel)

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

Total release size: 5.9 kB

Release files / rgb2hex-0.1.0.tar.gz

Download URL rgb2hex-0.1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a5d0ce6d4e0da663715f6172bda42dd7cb53835fedbb62091e1f6df372dbb7bf
BLAKE2b-256 checksum
How to use checksums
e4189ee9cca003cc7c64b5a015ed01ed6de3bc3f30a81812debcb96dc1f0b884
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / rgb2hex-0.1.0-py3-none-any.whl

Download URL rgb2hex-0.1.0-py3-none-any.whl
Size 3.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bd1253b53b45ccedaadb11ca735057ed38145c45545faa349418afa4f6c5bf3
BLAKE2b-256 checksum
How to use checksums
565fcc987ea44edb7759b760f412ae004204fe329bb3113d991b9754c65690fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5
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