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

@swiftlyme/color-spotter

v0.0.8

Published

> Pick colors from images, screen, URLs, hex input, or a full HSV picker — 100% browser-only. No signup. No server.

Readme

🎨 Color Spotter

Pick colors from images, screen, URLs, hex input, or a full HSV picker — 100% browser-only. No signup. No server.

Color Spotter is a modern Angular-based color exploration tool featuring:

  • 7 input methods
  • Live color harmonies
  • Tints & shades generation
  • Full color format conversions
  • Sidebar customization
  • Sticky results panel
  • Inline & popup HSV pickers
  • Zero backend dependency

🖥 Application UI Overview

The app uses a 3-column layout:

[ Sidebar ]   [ Center Panel ]   [ Results Panel ]

1️⃣ Sidebar (Method Selector)

  • Dynamically rendered navigation items
  • Toggle visibility of methods via Customize sidebar drawer
  • Minimum 1 method always enforced
  • Sticky positioning
  • Privacy badge ("100% private — browser only")

Supported methods:

| ID | Method | | --------------- | ------------------------------------ | | upload | Upload image | | paste | Paste from clipboard | | screen | Screen EyeDropper | | palette | Preset swatches | | url | Load from image URL | | hex | Enter hex manually | | picker | Full HSV picker | | method-selector | Embedded reusable selector component |

Users can toggle method visibility at runtime.


🎯 Center Panel – Input Methods

Upload Image

  • Click or drag & drop
  • Supports JPG, PNG, GIF, WebP
  • Click on image to sample pixel color

Paste Image

  • Uses Clipboard API
  • Paste screenshot directly
  • Click to sample

Screen Picker

  • Uses native EyeDropper API
  • Supported:
    • Chrome 95+
    • Edge 95+
    • Opera 81+
  • Graceful fallback message for unsupported browsers

Preset Palette

  • 24 default swatches
  • Click to instantly generate:
    • Harmonies
    • Tints
    • Shades
    • Full color breakdown

Image URL

  • Accepts direct image links
  • Loads into canvas
  • Click to sample

Hex Input

  • Accepts 6-digit hex (with/without #)
  • Live validation
  • Quick color grid
  • Generates:
    • HEX
    • RGB
    • HSL
    • HSV
    • CMYK
    • Harmonies
    • 5 Tints
    • 5 Shades

Inline HSV Picker

Features:

  • Saturation/Brightness gradient canvas
  • Hue slider
  • Opacity slider
  • Live hex editing
  • Copy button
  • Harmonies update in real-time

📊 Results Panel

Sticky right panel shows:

Primary Color

  • Large swatch preview
  • HEX
  • RGB
  • HSL
  • HSV
  • CMYK
  • Click-to-copy rows

Harmonies

  • Complementary
  • Analogous
  • Triadic
  • Additional variations
  • Clickable swatches

Tints

5 lighter variations

Shades

5 darker variations

All swatches are interactive and feed back into the system.


🔐 Privacy

  • 100% browser-based processing
  • No server calls
  • No image uploads
  • No tracking
  • All canvas operations client-side

Footer badge displayed in UI.


🧩 Reusable Package: colour-picker-utils

The project also ships a reusable Angular component and utility toolkit.


📦 Installation

npm install colour-picker-utils

🅰 Angular Drop-In Component

Import

import { ColorMethodSelectorComponent } from "colour-picker-utils";

@NgModule({
  imports: [ColorMethodSelectorComponent],
})
export class AppModule {}

Or standalone:

@Component({
  standalone: true,
  imports: [ColorMethodSelectorComponent]
})

Usage

<color-selection-method
  [initialColor]="'#e91e63'"
  [paletteColors]="myColors"
  (colorPicked)="onColor($event)"
>
</color-selection-method>

Inputs

| Input | Type | Default | Description | | ------------- | -------- | ----------- | -------------------- | | initialColor | string | '#2889e9' | Pre-seed color | | paletteColors | string[] | 24 defaults | Override palette tab |


Output

| Output | Type | Description | | ----------- | -------------------- | ------------------ | | colorPicked | EventEmitter | Emits selected hex |


⚙ Tab Management System

Each tab is defined as:

export interface TabItem {
  id: string;
  label: string;
  enabled: boolean;
}

Features:

  • Toggle via gear dropdown
  • Minimum 1 tab guard
  • Auto-redirect if active tab disabled
  • Outside click closes dropdown

Example:

toggleTab(tab: TabItem): void {
  const enabledCount = this.tabs.filter(t => t.enabled).length;
  if (tab.enabled && enabledCount <= 1) return;

  tab.enabled = !tab.enabled;

  if (!tab.enabled && this.activeMethod === tab.id) {
    const first = this.tabs.find(t => t.enabled);
    if (first) this.activeMethod = first.id;
  }
}

🛠 Utility Functions

Available utilities:

hexToRgb;
rgbToHex;
rgbToHsl;
rgbToHslValues;
rgbToHsvValues;
hsvToRgb;
hsvToHex;
rgbToCmyk;
getColorDetails;
generateColorHarmonies;
generateTints;
generateShades;
extractColorPalette;
extractColorPaletteFromFile;
getColorAtPixel;
getColorAtPixelFromFile;
isEyeDropperSupported;
pickColorFromScreen;
copyToClipboard;
isValidHex;
normaliseHex;
showColorPicker;

Example:

getColorDetails("#e91e63");
// {
//   hex: "#E91E63",
//   rgb: "rgb(233, 30, 99)",
//   hsl: "...",
//   hsv: "...",
//   cmyk: "..."
// }

🌐 Framework-Agnostic Popup Picker

Works without Angular:

import { showColorPicker } from "colour-picker-utils";

const destroy = showColorPicker({
  initialColor: "#3b82f6",
  showHarmonies: true,
  onPick: (details) => {
    console.log(details.hex);
  },
});

🎯 Key Architecture Highlights

  • Canvas-based color sampling
  • HSV gradient rendering
  • Sticky results wrapper
  • Responsive grid layouts
  • Fully component-driven
  • No external UI libraries
  • CSS animations & transitions
  • Client-side palette extraction

🧠 Use Cases

  • Design systems
  • Admin dashboards
  • Branding tools
  • CMS color pickers
  • Creative tools
  • Theme generators
  • Tag color selection
  • SaaS white-label systems

📞 Support

For issues, questions, or feature requests, please visit ([email protected])

🔗 Links