
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@standardbeagle/color
Advanced tools
WCAG contrast checking, color-harmony generation, color-vision-deficiency simulation, and image palette extraction. MCP server + library.
WCAG contrast checking, color-harmony generation, color-vision-deficiency simulation, and image palette extraction. MCP server + library.
npm install @standardbeagle/color
# or use via MCP:
npx -y @standardbeagle/color@latest mcp
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 }
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'] }
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',
});
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.
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.
MIT
FAQs
WCAG contrast checking, color-harmony generation, color-vision-deficiency simulation, and image palette extraction. MCP server + library.
We found that @standardbeagle/color demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.