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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@entropy-tamer/reynard-color-types

v0.17.1

Published

Shared color type definitions for the Reynard ecosystem

Readme

🎨 Reynard Color Types

Shared color type definitions for the Reynard ecosystem.

Overview

This package provides all color-related types and constants used across the Reynard framework, eliminating circular dependencies and ensuring consistent color type definitions.

Features

  • OKLCH Color Types: Perceptually uniform color space definitions
  • Theme Types: Theme names, variants, and configurations
  • Color Conversion Types: RGB, HSL, HSV, LAB color space interfaces
  • Colorblind Accessibility: Comprehensive color vision deficiency support
  • Constants: Theme names, color ranges, and validation constraints
  • Type Safety: Full TypeScript support with strict type checking

Installation

pnpm add reynard-color-types

Usage

Basic Types

import type { OKLCHColor, ThemeName, RGBColor } from "reynard-color-types";

const color: OKLCHColor = { l: 60, c: 0.25, h: 240 };
const theme: ThemeName = "dark";
const rgb: RGBColor = { r: 255, g: 0, b: 0 };

Theme Constants

import { THEME_NAMES, DEFAULT_THEME, isValidThemeName } from "reynard-color-types";

// Get all available themes
console.log(THEME_NAMES); // ["dark", "light", "gray", "banana", "strawberry", "peanut"]

// Check if theme is valid
if (isValidThemeName(userTheme)) {
  // Safe to use userTheme as ThemeName
}

Color Ranges

import { OKLCH_RANGES, WEB_SAFE_CONSTRAINTS } from "reynard-color-types";

// Validate OKLCH color values
const isValidLightness = (l: number) => l >= OKLCH_RANGES.lightness.min && l <= OKLCH_RANGES.lightness.max;

Colorblind Accessibility

import type {
  ColorVisionDeficiency,
  ColorblindSeverity,
  ContrastResult,
  ColorAccessibilityAssessment,
} from "reynard-color-types";
import { COLORBLIND_MATRICES, WCAG_THRESHOLDS, COLORBLIND_FRIENDLY_HUES } from "reynard-color-types";

// Define colorblind configuration
const deficiency: ColorVisionDeficiency = "protanopia";
const severity: ColorblindSeverity = "moderate";

// Check WCAG compliance
const contrastResult: ContrastResult = {
  ratio: 4.5,
  aaCompliant: true,
  aaaCompliant: false,
  normalText: true,
  largeText: true,
};

API Reference

Types

  • OKLCHColor - OKLCH color interface
  • OKLCHAColor - OKLCH color with alpha
  • ThemeName - Theme name union type
  • RGBColor - RGB color interface
  • HSLColor - HSL color interface
  • HSVColor - HSV color interface
  • LABColor - LAB color interface
  • ColorVisionDeficiency - Color vision deficiency types
  • ColorblindSeverity - Severity levels for colorblind simulation
  • ContrastResult - WCAG contrast analysis results
  • ColorAccessibilityAssessment - Comprehensive accessibility assessment

Constants

  • THEME_NAMES - All available theme names
  • DEFAULT_THEME - Default theme name
  • OKLCH_RANGES - OKLCH color value ranges
  • WEB_SAFE_CONSTRAINTS - Web-safe color constraints
  • COLORBLIND_MATRICES - Colorblind simulation matrices
  • WCAG_THRESHOLDS - WCAG contrast ratio thresholds
  • COLORBLIND_FRIENDLY_HUES - Accessible hue ranges for colorblind users
  • ACCESSIBLE_CHROMA_RANGES - Chroma ranges for accessibility
  • ACCESSIBLE_LIGHTNESS_RANGES - Lightness ranges for accessibility

Utilities

  • isValidThemeName() - Validate theme name
  • getThemeCategory() - Get theme category (dark/light)
  • getThemesByCategory() - Get themes by category

Contributing

This package is part of the Reynard ecosystem. Please follow the project's contribution guidelines.

License

MIT