Extension Icon

Color Picker

Pick and organize colors, everywhere on your Mac
AvatarThomas Paul Mann
56,808 Installs

Color Picker

A simple system-wide color picker. The color picker can be triggered with a standalone command or as part of the menu bar command. The menu bar shows the last nine picked colors. The Organize Colors command can be used to see all colors.

raycast-cross-extension-badge

API

This extensions follows Raycast Cross-Extension Conventions.

You can use launchCommand to use the picker color result.

Launch Context Options

copyToClipboard

Type: boolean
Default: false

Copy to clipboard is disabled by default. Set it to true to enable copy action.

callbackLaunchOptions

Type: LaunchOptions
Default: undefined

Use this option to let this extension know what kind of callback needs to be performed when launchCommand.

Callback Context Options

hex

Type: string

It returns the color picker hex result.

Examples

Launch Color Picker

import { launchCommand, LaunchType } from "@raycast/api";

await launchCommand({
  name: "pick-color",
  type: LaunchType.UserInitiated,
  extensionName: "color-picker",
  ownerOrAuthorName: "thomas",
  context: {
    callbackLaunchOptions: {
      name: "your-command-name",
      type: LaunchType.UserInitiated,
      extensionName: "your-extension-name",
      ownerOrAuthorName: "your-author-name",
      context: {
        launchFromExtensionName: "color-picker",
        // ...
      },
    },
  },
});

Rececive Callback Result

import { LaunchProps } from "@raycast/api";

type LaunchContext = {
  launchFromExtensionName: string;
  hex: string;
};

export default function Command({ launchContext = {} }: LaunchProps<{ launchContext?: LaunchContext }>) {
  const { launchFromExtensionName, hex } = launchContext;

  useEffect(() => {
    if (launchContext.launchFromExtensionName === "color-picker" && launchContext.hex) {
      console.log(launchContext.hex);
    }
  }, []);
}