Convert colors from one format to another.
Project description
colorforms
Convert colors from one format to another.
This tool will read a color in rgb or hex format piped from stdin, and convert to the opposite format (rgb -> hex, hex -> rgb).
Example:
$ echo "#FFEE00" | colorforms
rgb(255, 238, 0)
Usage notes:
The following patterns are valid:
hhh (rgb)
#hhh (rgb)
hhhh (rgba)
#hhhh (rgba)
hhhhhh (rgb)
#hhhhhh (rgb)
hhhhhhhh (rgba)
#hhhhhhhh (rgba)
rgb(n,n,n) (rgb)
rgb(n,n,n,n) (rgba)
rgba(n,n,n,n) (rgba)
Installation
From PyPi:
pip install colorforms
...or...
python -m pip install colorforms
Geany integration
I use this tool inside Geany, to quickly convert colors back and forth with a keyboard shortcut.
- From the Geany menu, select "Edit -> Format -> Send selection to -> Set custom commands"
- In the popup dialog, choose an empty Command / Label line. In the "Command" field, type "colorforms". Add an appropriate label, such as "Convert color format".
Now this tool will be available from the Edit menu.
- Select the string you want to convert.
- From the Geany menu, select "Edit -> Format -> Send selection to -> Convert color format"
If you put this tool in one of the first three lines, you automatically get a keyboard shortcut you can use to invoke it. For example, entering colorforms on line 2 will make it possible to select a color value, and simply press "CTRL-2" to convert to the opposite format.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file colorforms-1.0.0.tar.gz.
File metadata
- Download URL: colorforms-1.0.0.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3885a754caa06868949bbd2c00f14ea0169f34d3e01f4c8ef689e75685113c2
|
|
| MD5 |
0a58685b4b2dc274d810bc20b423905c
|
|
| BLAKE2b-256 |
a984baad738140199070ee3d88661d8185c331cfe511db69bcdd1d1455a63609
|
File details
Details for the file colorforms-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: colorforms-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f7a8ae08e6da16b540170cec1e7d27df464b552008da4112264831c6ba8b356
|
|
| MD5 |
c04039d8ff8f3102214236e2c34c3bc3
|
|
| BLAKE2b-256 |
359a6d9332b2a295a8ad95afc6f80309abe1bd03f552ca059ea67cedb342fb3d
|