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

@cattn/hdr

v0.4.0

Published

A Svelte library for rendering color in HDR

Readme

@cattn/hdr

A Svelte library for rendering element colors in HDR.

Installation

npm i @cattn/hdr

Usage

Router

import { HDRRouter } from '@cattn/hdr';

Place in src/+layout.svelte:

<script lang="ts">
	import { HDRRouter } from '@cattn/hdr';
</script>

<!-- This should be at the top of your file! -->
<HDRRouter />

Configuration

Amplification
Adjust HDR intensity across platforms (default 1.8).

<HDRRouter amplification={1.5} />

Delay
Apply an artificial delay before HDR styles (default 0 ms).

<HDRRouter delay={100} />

hdrify

Converts the element's color to HDR.

<script lang="ts">
	import { hdrify } from '@cattn/hdr';
</script>

<h2 style="color: #00ff00" {@attach hdrify()}>The color is in HDR!!</h2>

hdrifyBackground

Converts the element's background-color to HDR.

<script lang="ts">
	import { hdrifyBackground } from '@cattn/hdr';
</script>

<h2 style="background-color: #00ff00" {@attach hdrifyBackground()}>The background is in HDR!!</h2>

hdrifyHex

Pass a $state rune or a hex string to set HDR color dynamically.

<script lang="ts">
	import { hdrifyHex } from '@cattn/hdr';

	let color = $state('#ff006f');
</script>

<h2 {@attach hdrifyHex(color)}>The color is in HDR!!</h2>

hdrifyBackgroundHex

Pass a $state rune or a hex string to set HDR background dynamically.

<script lang="ts">
	import { hdrifyBackgroundHex } from '@cattn/hdr';

	let color = $state('#ff006f');
</script>

<h2 {@attach hdrifyBackgroundHex(color)}>The background is in HDR!!</h2>

setHdrEnabled

Set HDR on or off globally.

<script lang="ts">
	import { setHdrEnabled } from '@cattn/hdr';
</script>

<button on:click={() => setHdrEnabled(false)}>Disable HDR</button>
<button on:click={() => setHdrEnabled(true)}>Enable HDR</button>

enableHDR

Convenience helper to enable HDR globally.

<script lang="ts">
	import { enableHDR } from '@cattn/hdr';
</script>

<button on:click={enableHDR}>Enable HDR</button>

disableHDR

Convenience helper to disable HDR globally.

<script lang="ts">
	import { disableHDR } from '@cattn/hdr';
</script>

<button on:click={disableHDR}>Disable HDR</button>

isHdrEnabled

Read the current HDR state.

<script lang="ts">
	import { isHdrEnabled } from '@cattn/hdr';

	const hdrOn = isHdrEnabled();
</script>

<p>HDR is {hdrOn ? 'enabled' : 'disabled'}.</p>

setLogEnabled

Set logging on or off globally.

<script lang="ts">
	import { setLogEnabled } from '@cattn/hdr';
</script>

<button on:click={() => setLogEnabled(false)}>Disable Logging</button>
<button on:click={() => setLogEnabled(true)}>Enable Logging</button>

enableLog

Convenience helper to enable logging globally.

<script lang="ts">
	import { enableLog } from '@cattn/hdr';
</script>

<button on:click={enableLog}>Enable Logging</button>

disableLog

Convenience helper to disable logging globally.

<script lang="ts">
	import { disableLog } from '@cattn/hdr';
</script>

<button on:click={disableLog}>Disable Logging</button>

isLogEnabled

Read the current logging state.

<script lang="ts">
	import { isLogEnabled } from '@cattn/hdr';

	const logOn = isLogEnabled();
</script>

<p>Logging is {logOn ? 'enabled' : 'disabled'}.</p>

Developing

After npm install, start a development server:

npm run dev

Library code lives in src/lib; demo/tests in src/routes.

Building

To build the library:

npm run build