Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/webtechmoz/rgb2hex
Biblioteca para conversão de cores entre rgb e hexadecimal
https://github.com/webtechmoz/rgb2hex
Last synced: 1 day ago
JSON representation
Biblioteca para conversão de cores entre rgb e hexadecimal
- Host: GitHub
- URL: https://github.com/webtechmoz/rgb2hex
- Owner: webtechmoz
- License: mit
- Created: 2024-10-22T12:52:30.000Z (29 days ago)
- Default Branch: master
- Last Pushed: 2024-10-22T12:54:38.000Z (29 days ago)
- Last Synced: 2024-10-23T08:43:35.697Z (28 days ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.