Skip to main content

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.

  1. From the Geany menu, select "Edit -> Format -> Send selection to -> Set custom commands"
  2. 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.

  1. Select the string you want to convert.
  2. 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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colorforms-1.0.2.tar.gz (13.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

colorforms-1.0.2-py2.py3-none-any.whl (15.2 kB view details)

Uploaded Python 2Python 3

File details

Details for the file colorforms-1.0.2.tar.gz.

File metadata

  • Download URL: colorforms-1.0.2.tar.gz
  • Upload date:
  • Size: 13.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for colorforms-1.0.2.tar.gz
Algorithm Hash digest
SHA256 c3df28b482dd07d3d0e65f67a48402c6ba5e37e800a6d49b502b10a36bcdaa29
MD5 bab8e5bfcc9d24fe4fe443b03a3edeed
BLAKE2b-256 5a8af24310db9edcf7f66a580ba0c505bfbdc1ae4bdc6e32701aebc5f0d69f68

See more details on using hashes here.

File details

Details for the file colorforms-1.0.2-py2.py3-none-any.whl.

File metadata

  • Download URL: colorforms-1.0.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for colorforms-1.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 77246ebdd3195e4ac9f9e145125c261d09f14cb95aad951f7112582598c8457c
MD5 632d56e7e6d56bf2194e2cde89309e0c
BLAKE2b-256 e3ceda2f9dcf56522f440063ce40d37781c5b26f89df5fc430c02008265128ff

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 files

1.0.1

2 files

1.0.0

2 files

0.0.0

2 files

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