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

react-cie-1931

v0.5.0

Published

CIE 1931 color space component

Readme

react-cie-1931

CIE 1931 Chromaticity Diagram

A React component for rendering an interactive CIE 1931 chromaticity diagram with WebGL-accelerated rendering.

Overview

The CIE 1931 color space, also known as the CIE XYZ color space, is a fundamental model for representing colors based on human perception. Developed by the International Commission on Illumination (CIE) in 1931, it maps all visible colors within a horseshoe-shaped diagram, often referred to as the chromaticity diagram. This diagram represents:

  • Chromaticity: The x and y coordinates on the diagram correspond to the color's hue and saturation, independent of brightness.
  • Color Gamut: The outer boundary shows the purest, most saturated colors (monochromatic light), while the interior represents mixed or less saturated colors.
  • White Point: The central area approximates neutral or white light.

This React component, react-cie-1931, renders an interactive version of the CIE 1931 chromaticity diagram with smooth performance and accurate color representation, making it ideal for color science, design, and digital imaging applications.

Features

  • Interactive Zoom & Pan: Mouse wheel to zoom, click and drag to pan
  • WebGL Rendering: Smooth performance with hardware acceleration
  • Multiple Color Spaces: Display and compare different color gamuts
  • Planckian Locus: Optional black-body radiation curve
  • Accessibility: ARIA labels and keyboard navigation support
  • Responsive Design: Adapts to container size with proper scaling

Requirements

  • React 19.0+ - This component is built specifically for React 19 to take advantage of the latest features and optimizations.

Installation

To use the react-cie-1931 component in your React project, follow these steps:

  1. Install the package via npm or pnpm:

    npm install react-cie-1931
    # or
    pnpm add react-cie-1931
  2. Import the component into your React application:

    // Named import (recommended)
    import { ChromaticityDiagram } from 'react-cie-1931';
       
    // Or default import
    import ChromaticityDiagram from 'react-cie-1931';
       
    // With TypeScript types
    import { ChromaticityDiagram, type ChromaticityDiagramProps } from 'react-cie-1931';
  3. Use the component in your JSX:

    <ChromaticityDiagram />

Basic Usage

The ChromaticityDiagram component can be used as-is for a default visualization of the CIE 1931 color space. You can customize its appearance and behavior with various props:

<ChromaticityDiagram
  colorSpaces={[
    {
      name: "sRGB",
      primaries: { r: [0.64, 0.33], g: [0.3, 0.6], b: [0.15, 0.06] },
      whitepoint: [0.3127, 0.329],
      color: "rgba(255, 0, 0, 0.8)"
    },
    {
      name: "Display P3",
      primaries: { r: [0.708, 0.292], g: [0.17, 0.797], b: [0.131, 0.046] },
      whitepoint: [0.3127, 0.329],
      color: "rgba(0, 255, 0, 0.8)"
    }
  ]}
  showPlanckianLocus={true}
  colorSpace="display-p3"
  axisLabelColor="#333"
  gridLineColor="rgba(0, 0, 0, 0.2)"
/>

Learn More

Explore the interactive Storybook documentation to see examples and learn about the customization options available for the react-cie-1931 component.

For more information, source code, and to report issues, visit the GitHub repository: github.com/derekrein/react-cie-1931.