Skip to main content

Convert between color formats - hex, RGB, HSL, and color names

Project description

colorcli

Convert between color formats - hex, RGB, HSL, and CSS named colors.

pip install colorcli

Usage

# Convert any color format
colors convert "#ff5733"
colors convert "rgb(255, 87, 51)"
colors convert coral

# Specific format conversions
colors hex "#ff5733"
colors rgb 255 87 51
colors hsl 11 100 60
colors name coral

# Generate palettes
colors palette "#ff5733" 5 --type analogous
colors palette coral 3 --type triadic
colors palette "#336699" --type complementary

# Utility commands
colors blend "#ff0000" "#0000ff"
colors contrast "#ff5733"
colors names              # List all CSS color names

Commands

Command Description
convert COLOR Convert any color to all formats
hex HEX Convert hex to RGB/HSL
rgb R G B Convert RGB to hex/HSL
hsl H S L Convert HSL to hex/RGB
name NAME Look up CSS named color
names List all 140 CSS named colors
palette COLOR [COUNT] Generate color palette
blend COLOR1 COLOR2 Mix two colors
contrast COLOR Suggest text color for background
random-gradient COLOR Generate CSS gradient

Palette Types

  • complementary - Opposite on color wheel
  • analogous - Adjacent colors (default)
  • triadic - Three colors 120° apart
  • tetradic - Four colors 90° apart
  • split - Split-complementary
  • shades - Darker versions
  • tints - Lighter versions

JSON Output

All commands support --json for machine-readable output:

colors convert "#ff5733" --json
{
  "hex": "#ff5733",
  "rgb": {"r": 255, "g": 87, "b": 51},
  "rgb_string": "rgb(255, 87, 51)",
  "hsl": {"h": 11, "s": 100, "l": 60},
  "hsl_string": "hsl(11, 100%, 60%)",
  "name": null
}

For AI Agents

See SKILL.md for agent-optimized documentation.

License

MIT

Project details


Download files

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

Source Distribution

colorconv_cli-0.1.0.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

colorconv_cli-0.1.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file colorconv_cli-0.1.0.tar.gz.

File metadata

  • Download URL: colorconv_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for colorconv_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37739d3638c2bc52e749bb1c19ba4566609a42f4baad7901c97e2250428fb31d
MD5 d54c65c675416eead24981f9fd81ad86
BLAKE2b-256 83c4ab0fb82e7e715262a201c3f78f259e565967b4b04f558c3bc0948bf0ec53

See more details on using hashes here.

File details

Details for the file colorconv_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: colorconv_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for colorconv_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 efda3d0970db8c99d5c19b04ac2ff77199cfd2550762287b5d1fdb6deb706bdf
MD5 e7e695ad4d58ac0ef22f74878fb262a0
BLAKE2b-256 4e2ee62812fac389e8921c58684aa3dfa25c7bfd9a8e86a483ef94595349f0f7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page