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

@voltr-token-studio/token-derivation

v0.1.0

Published

Deterministic token derivation utilities for Voltr Token Studio

Readme

@voltr/token-derivation

Deterministic design-token derivation utilities for Voltr Token Studio.

Install

npm install @voltr/token-derivation

Usage

Color scale from a single seed

import { deriveColorScale } from '@voltr/token-derivation'

const palette = deriveColorScale('#2563eb')

console.log(palette)
// {
//   '50':  '#eff6ff',
//   '100': '#dbeafe',
//   ...
//   '500': '#2563eb',
//   ...
//   '900': '#1e3a8a',
// }

The seed defaults to tone 500. Pass anchorTone for a different anchor:

deriveColorScale('#dc2626', { anchorTone: 600 })

Full family with metadata

import { deriveColorFamily } from '@voltr/token-derivation'

const family = deriveColorFamily('#2563eb', existingFamily, {
  familyName: 'blue',
})

// family['500'].$value === '#2563eb'
// family.$extensions.voltr.derivation.formula === 'oklch-v1'

Spacing scale

import { deriveSpacingScale } from '@voltr/token-derivation'

const spacing = deriveSpacingScale(existingScale, { baseUnit: 4 })

// spacing['4'].$value === { value: 16, unit: 'px' }

Radius preset

import { deriveRadiusScale } from '@voltr/token-derivation'

const radius = deriveRadiusScale(existingScale)

// radius.md.$value === { value: 8, unit: 'px' }

API

| Export | Description | |--------|-------------| | deriveColorScale(seedHex, options?) | Returns { [tone]: hex } from a seed color | | deriveColorFamily(seedHex, existingFamily?, options?) | Returns a full token family object with $value leaves | | deriveSpacingScale(existingScale?, options?) | Returns a token group with derived dimension values | | deriveRadiusScale(existingScale?, options?) | Returns a token group with the default radius preset | | normalizeHexColor(hex) | Normalizes 3-digit and 6-digit hex with validation |

All functions are pure — no I/O, no side effects.

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | anchorTone | number | 500 | Which tone the seed represents | | toneProfile | object | TONE_PROFILE_V1 | Per-tone lightness and chroma mapping | | tones | string[] | STANDARD_COLOR_TONES | Which tone keys to emit | | baseUnit | number | 4 | Base pixel unit for spacing | | preset | object | DEFAULT_RADIUS_PRESET | Key-value radius map | | formulaVersion | string | 'oklch-v1' | Written into $extensions.voltr.derivation |

Formula

Colors are derived in OKLCH space for perceptual uniformity. The v1 profile maps 10 standard tones (50900) from a single seed using fixed lightness offsets and chroma multipliers. Out-of-gamut colors are fitted to sRGB via binary search.

License

Private — Voltr Token Studio thesis project.