Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.dev1022

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.dev1022
File Size Uploaded
rgb2hex-0.1.0.dev1022.tar.gz 2.8 kB Details

Built distribution (wheel)

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

Total release size: 6.0 kB

Release files / rgb2hex-0.1.0.dev1022.tar.gz

Download URL rgb2hex-0.1.0.dev1022.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
849720776ab910b9253f04bae2de3b190a855aebd084e26c4ebaf087b921688d
BLAKE2b-256 checksum
How to use checksums
f07fca6a44c8fe6147401690c288882466ca44c181f12dddf3fd8ad629517769
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.dev1022-py3-none-any.whl

Download URL rgb2hex-0.1.0.dev1022-py3-none-any.whl
Size 3.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d71605613d333d951e3a0dceaf05003b9965f1382923f17cef18cc22580029ed
BLAKE2b-256 checksum
How to use checksums
26885c14b970f5899885129461c92f7073f784b8ea888c7de8c7bca7dc3cb021
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