# 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:
```bash
pip install rgb2hex
```
## Convert Hex to RGB
You can convert a hexadecimal color code to an RGB tuple like this:
```python
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:
```python
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.
Raw data
{
"_id": null,
"home_page": "https://github.com/webtechmoz/rgb2hex.git",
"name": "rgb2hex",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "hex2rgb, rgb2hex, rgbtohexadecimal, hex-to-rgb, rgbhex",
"author": "Web Tech Moz",
"author_email": "zoidycine@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e4/18/9ee9cca003cc7c64b5a015ed01ed6de3bc3f30a81812debcb96dc1f0b884/rgb2hex-0.1.0.tar.gz",
"platform": null,
"description": "# RGB2HEX\r\n\r\nA simple Python library for converting between Hexadecimal and RGB color formats.\r\n\r\nFeatures\r\n- Convert Hex color codes to RGB format.\r\n- Convert RGB format back to Hex color codes.\r\n\r\n## Installation\r\n\r\nTo install the library via pip:\r\n\r\n```bash\r\npip install rgb2hex\r\n```\r\n\r\n## Convert Hex to RGB\r\n\r\nYou can convert a hexadecimal color code to an RGB tuple like this:\r\n\r\n```python\r\nfrom rgb2hex import hex2rgb\r\n\r\n# Example usage\r\nhex_code = \"#ff5733\"\r\nrgb = hex2rgb(hex_code)\r\nprint(rgb) # Output: (255, 87, 51)\r\n```\r\n\r\n## Convert RGB to Hex\r\nYou can convert an RGB list to a hexadecimal color code:\r\n\r\n```python\r\nfrom rgb2hex import rgb2hex\r\n\r\n# Example usage\r\nrgb = [255, 87, 51]\r\nhex_code = rgb2hex(rgb)\r\nprint(hex_code) # Output: #ff5733\r\n```\r\n\r\n## Contributing\r\nFeel free to open issues or submit pull requests if you'd like to contribute.\r\n\r\n## License\r\nThis project is licensed under the MIT License.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple Python library for converting between Hexadecimal and RGB color formats",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/webtechmoz/rgb2hex.git"
},
"split_keywords": [
"hex2rgb",
" rgb2hex",
" rgbtohexadecimal",
" hex-to-rgb",
" rgbhex"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "565fcc987ea44edb7759b760f412ae004204fe329bb3113d991b9754c65690fc",
"md5": "0f1a55f664c4d7ceb2f3b57a5d2b7db2",
"sha256": "1bd1253b53b45ccedaadb11ca735057ed38145c45545faa349418afa4f6c5bf3"
},
"downloads": -1,
"filename": "rgb2hex-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0f1a55f664c4d7ceb2f3b57a5d2b7db2",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 3117,
"upload_time": "2024-10-22T10:23:27",
"upload_time_iso_8601": "2024-10-22T10:23:27.529294Z",
"url": "https://files.pythonhosted.org/packages/56/5f/cc987ea44edb7759b760f412ae004204fe329bb3113d991b9754c65690fc/rgb2hex-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e4189ee9cca003cc7c64b5a015ed01ed6de3bc3f30a81812debcb96dc1f0b884",
"md5": "100ce200e73d8ad138997a98421f9603",
"sha256": "a5d0ce6d4e0da663715f6172bda42dd7cb53835fedbb62091e1f6df372dbb7bf"
},
"downloads": -1,
"filename": "rgb2hex-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "100ce200e73d8ad138997a98421f9603",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 2778,
"upload_time": "2024-10-22T10:23:30",
"upload_time_iso_8601": "2024-10-22T10:23:30.662949Z",
"url": "https://files.pythonhosted.org/packages/e4/18/9ee9cca003cc7c64b5a015ed01ed6de3bc3f30a81812debcb96dc1f0b884/rgb2hex-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-22 10:23:30",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "webtechmoz",
"github_project": "rgb2hex",
"github_not_found": true,
"lcname": "rgb2hex"
}