Skip to content

Pika ​

Pika is a native color picker for macOS. Protocol Launcher allows you to generate deep links to control Pika's color picking, formatting, and appearance settings.

Usage ​

There are two ways to use this library:

  • On-Demand import from subpaths enables tree-shaking and keeps bundles small.
  • Full Import from the root package is convenient but includes all app modules.

Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.

Select Installation Method

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

copyForeground and copyBackground accept an optional type (hex, rgb, hsb, hsl, lab, opengl, oklch). Omitting it keeps the current output format.

Actions ​

Swap ​

{{currentMethod}}
ts
import { swap } from 'protocol-launcher/pika'

const url = swap()

Undo ​

{{currentMethod}}
ts
import { undo } from 'protocol-launcher/pika'

const url = undo()

Redo ​

{{currentMethod}}
ts
import { redo } from 'protocol-launcher/pika'

const url = redo()

Appearance ​

Light ​

{{currentMethod}}
ts
import { light } from 'protocol-launcher/pika'

const url = light()

Dark ​

{{currentMethod}}
ts
import { dark } from 'protocol-launcher/pika'

const url = dark()

System ​

{{currentMethod}}
ts
import { system } from 'protocol-launcher/pika'

const url = system()

Copy ​

Copy Foreground ​

{{currentMethod}}
ts
import { copyForeground } from 'protocol-launcher/pika'

const url = copyForeground()

Copy Background ​

{{currentMethod}}
ts
import { copyBackground } from 'protocol-launcher/pika'

const url = copyBackground()

Copy Text ​

{{currentMethod}}
ts
import { copyText } from 'protocol-launcher/pika'

const url = copyText()

Copy JSON ​

{{currentMethod}}
ts
import { copyJson } from 'protocol-launcher/pika'

const url = copyJson()

Format ​

Format Hex ​

{{currentMethod}}
ts
import { formatHex } from 'protocol-launcher/pika'

const url = formatHex()

Format RGB ​

{{currentMethod}}
ts
import { formatRgb } from 'protocol-launcher/pika'

const url = formatRgb()

Format HSB ​

{{currentMethod}}
ts
import { formatHsb } from 'protocol-launcher/pika'

const url = formatHsb()

Format HSL ​

{{currentMethod}}
ts
import { formatHsl } from 'protocol-launcher/pika'

const url = formatHsl()

Format LAB ​

{{currentMethod}}
ts
import { formatLab } from 'protocol-launcher/pika'

const url = formatLab()

Format OpenGL ​

{{currentMethod}}
ts
import { formatOpenGL } from 'protocol-launcher/pika'

const url = formatOpenGL()

Format OKLCH ​

{{currentMethod}}
ts
import { formatOklch } from 'protocol-launcher/pika'

const url = formatOklch()

History ​

Show History ​

{{currentMethod}}
ts
import { showHistory } from 'protocol-launcher/pika'

const url = showHistory()

Hide History ​

{{currentMethod}}
ts
import { hideHistory } from 'protocol-launcher/pika'

const url = hideHistory()

Toggle History ​

{{currentMethod}}
ts
import { toggleHistory } from 'protocol-launcher/pika'

const url = toggleHistory()

Pick ​

Pick Foreground ​

{{currentMethod}}
ts
import { pickForeground } from 'protocol-launcher/pika'

const url = pickForeground({
  type: 'hex',
})

Pick Background ​

{{currentMethod}}
ts
import { pickBackground } from 'protocol-launcher/pika'

const url = pickBackground({
  type: 'rgb',
})

Set Color ​

Set Foreground ​

{{currentMethod}}
ts
import { setForeground } from 'protocol-launcher/pika'

const url = setForeground({
  hex: 'fbbf24',
})

Set Background ​

{{currentMethod}}
ts
import { setBackground } from 'protocol-launcher/pika'

const url = setBackground({
  hex: 'e74661',
})

System ​

System Foreground ​

{{currentMethod}}
ts
import { systemForeground } from 'protocol-launcher/pika'

const url = systemForeground()

System Background ​

{{currentMethod}}
ts
import { systemBackground } from 'protocol-launcher/pika'

const url = systemBackground()

Window ​

About ​

{{currentMethod}}
ts
import { about } from 'protocol-launcher/pika'

const url = about()

Help ​

{{currentMethod}}
ts
import { help } from 'protocol-launcher/pika'

const url = help()

Preferences ​

{{currentMethod}}
ts
import { preferences } from 'protocol-launcher/pika'

const url = preferences()

Resize ​

{{currentMethod}}
ts
import { resize } from 'protocol-launcher/pika'

const url = resize({
  width: 480,
  height: 300,
})

Pick a contrasting color ​

Pick a contrasting color.

{{currentMethod}}
ts
import { pickContrast } from 'protocol-launcher/pika'

const url = pickContrast()

Show compliance information ​

Show compliance information.

{{currentMethod}}
ts
import { showCompliance } from 'protocol-launcher/pika'

const url = showCompliance()

Hide compliance information ​

Hide compliance information.

{{currentMethod}}
ts
import { hideCompliance } from 'protocol-launcher/pika'

const url = hideCompliance()

Toggle compliance information ​

Toggle compliance information.

{{currentMethod}}
ts
import { toggleCompliance } from 'protocol-launcher/pika'

const url = toggleCompliance()

Show the color preview ​

Show the color preview.

{{currentMethod}}
ts
import { showPreview } from 'protocol-launcher/pika'

const url = showPreview()

Hide the color preview ​

Hide the color preview.

{{currentMethod}}
ts
import { hidePreview } from 'protocol-launcher/pika'

const url = hidePreview()

Toggle the color preview ​

Toggle the color preview.

{{currentMethod}}
ts
import { togglePreview } from 'protocol-launcher/pika'

const url = togglePreview()

Open the splash window ​

Open the splash window.

{{currentMethod}}
ts
import { splash } from 'protocol-launcher/pika'

const url = splash()

Official Documentation ​