npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@standardbeagle/color

v0.1.0

Published

WCAG contrast checking, color-harmony generation, color-vision-deficiency simulation, and image palette extraction. MCP server + library.

Readme

@standardbeagle/color

WCAG contrast checking, color-harmony generation, color-vision-deficiency simulation, and image palette extraction. MCP server + library.

Install

npm install @standardbeagle/color

# or use via MCP:
npx -y @standardbeagle/color@latest mcp

Tools

contrast_check

Calculate the WCAG 2.x contrast ratio between two colors and check it against AA/AAA thresholds.

Input:

{
  foreground: string,                       // hex or rgb
  background: string,                       // hex or rgb
  target?: 'AA' | 'AAA',                    // default 'AA'
  text_size?: 'normal' | 'large',           // default 'normal'
}

Output:

{
  ratio: number,            // e.g. 4.54
  passes: boolean,          // passes target at text_size
  required: number,         // required ratio for the chosen target/size
}

Example:

const result = await callTool('contrast_check', {
  foreground: '#000000',
  background: '#ffffff',
  target: 'AA',
});
// { ratio: 21, passes: true, required: 4.5 }

harmony_generate

Generate a color harmony palette from a base color.

Input:

{
  base: string,                             // hex
  scheme: 'complementary' | 'triadic' | 'analogous'
        | 'split-complementary' | 'tetradic' | 'monochromatic',
  count?: number,                           // for monochromatic / analogous
}

Output:

{
  scheme: string,
  base: string,
  colors: string[],         // hex strings, includes base
}

Example:

const result = await callTool('harmony_generate', {
  base: '#0066cc',
  scheme: 'triadic',
});
// { scheme: 'triadic', base: '#0066cc', colors: ['#0066cc', '#cc0066', '#66cc00'] }

color_blindness_simulate

Simulate deuteranopia / protanopia / tritanopia on one color or a palette.

Input:

{
  colors: string | string[],
  type?: 'deuteranopia' | 'protanopia' | 'tritanopia' | 'all', // default 'all'
  severity?: number,                                            // 0..1, default 1
}

Output:

{
  results: Array<{
    original: string,
    simulations: {
      deuteranopia?: string,
      protanopia?: string,
      tritanopia?: string,
    },
  }>,
}

Example:

const result = await callTool('color_blindness_simulate', {
  colors: ['#ff0000', '#00ff00'],
  type: 'deuteranopia',
});

palette_extract

Extract a dominant-color palette from an image using k-means clustering on a sub-sampled pixel set.

Input:

{
  image: string,           // absolute filesystem path
  k?: number,              // 2..16, default 5
  sample_pixels?: number,  // 100..100000, default 10000
}

Output:

{
  colors: Array<{
    hex: string,
    rgb: { r: number, g: number, b: number },
    weight: number,        // share of clustered pixels
  }>,
  k: number,
  sampled_pixels: number,
}

Example:

const result = await callTool('palette_extract', {
  image: '/abs/path/to/photo.jpg',
  k: 5,
});

Same algorithm as image-processing.palette_from_image; the duplication is intentional so that callers using only one MCP can get a palette without pulling in the other surface.

Direct TypeScript usage

Each tool's pure handler is exported and can be called without going through MCP:

import { contrastCheck } from '@standardbeagle/color/tools/contrast-check.js';
import { generateHarmony } from '@standardbeagle/color/tools/harmony-generate.js';
import { colorBlindness } from '@standardbeagle/color/tools/color-blindness.js';
import { paletteExtract } from '@standardbeagle/color/tools/palette-extract.js';

const ratio = contrastCheck({ foreground: '#000', background: '#fff' });

Each schema is also exported (*.schema.ts) as a Zod schema for input validation.

License

MIT