Skip to main content

Color Picker

 ██████╗ ██████╗ ██╗      ██████╗ ██████╗ ███████╗
██╔════╝██╔═══██╗██║     ██╔═══██╗██╔══██╗██╔════╝
██║     ██║   ██║██║     ██║   ██║██████╔╝███████╗
██║     ██║   ██║██║     ██║   ██║██╔══██╗╚════██║
╚██████╗╚██████╔╝███████╗╚██████╔╝██║  ██║███████║
╚═════╝ ╚═════╝ ╚══════╝ ╚═════╝ ╚═╝  ╚═╝╚══════╝

The dms color pick command launches an interactive color picker for Wayland. Click any pixel on your screen to capture its color, with support for multiple output formats and custom templates.

Quick Start

# Pick a color, output as hex
dms color pick

# Output as RGB
dms color pick --rgb

# Auto-copy to clipboard
dms color pick -a

Press Escape to cancel the picker at any time.

Output Formats

Only one format flag can be used at a time. Default is --hex.

FlagOutputExample
--hexHexadecimal#FF8040
--rgbRGB values255 128 64
--hslHSL values24 75% 60%
--hsvHSV values24 75% 100%
--cmykCMYK values0% 50% 75% 0%
--jsonAll formatsSee below

JSON Output

dms color pick --json

Returns all color formats in a single JSON object, useful for scripting.

Custom Format Templates

The -o flag lets you define a custom output format using placeholders {0}, {1}, {2} (and {3} for CMYK).

Placeholder Reference

Format0123
--hex (default)R (hex, e.g. FF)G (hex)B (hex)-
--rgbR (0-255)G (0-255)B (0-255)-
--hslH (0-360)S (0-100)L (0-100)-
--hsvH (0-360)S (0-100)V (0-100)-
--cmykC (0-100)M (0-100)Y (0-100)K (0-100)

Examples

# CSS rgb() function
dms color pick --rgb -o "rgb({0}, {1}, {2})"
# Output: rgb(255, 128, 64)

# CSS hsl() function
dms color pick --hsl -o "hsl({0}, {1}%, {2}%)"
# Output: hsl(24, 75%, 60%)

# Hex without hash
dms color pick -o "{0}{1}{2}"
# Output: FF8040

# Custom CMYK format
dms color pick --cmyk -o "C={0} M={1} Y={2} K={3}"
# Output: C=0 M=50 Y=75 K=0

Options

FlagShortDescription
--hexOutput as hexadecimal (#RRGGBB)
--rgbOutput as RGB (R G B)
--hslOutput as HSL (H S% L%)
--hsvOutput as HSV (H S% V%)
--cmykOutput as CMYK (C% M% Y% K%)
--jsonOutput all formats as JSON
--lowercase-lOutput hex in lowercase
--autocopy-aCopy result to clipboard
--output-format-oCustom output format template
--config-cCustom DMS config directory path
--help-hShow help

Use Cases

Quick Color Reference

Grab any color from your screen for use in design work:

dms color pick -a
# Picked color is now in your clipboard

CSS Development

Get colors ready for your stylesheets:

# For CSS custom properties
dms color pick --hsl -o "hsl({0}deg {1}% {2}%)" -a

# For rgba with full opacity
dms color pick --rgb -o "rgba({0}, {1}, {2}, 1)" -a

Color Extraction Scripts

Capture colors programmatically:

#!/bin/bash
color=$(dms color pick --json)
hex=$(echo "$color" | jq -r '.hex')
echo "Selected: $hex"