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

super-spectrum

v1.2.0

Published

Advance color picker

Readme

Super Spectrum

Super Spectrum is an Advanced Color Picker Library.

Features

  • Select Colors easily by dragging the selectors on the canvas.
  • Use the hue canvas to get all the color ranges.
  • The spectrum canvas provides the whole spectrum from black to white to the hue color.
  • Set the alpha values for rgb colors by entering in the input.
  • Get instant conversion from Hex to Rgba.
  • Pick color from page and also get its hex and rgba directly in the input.

Usage

Props

import SuperSpectrum from "super-spectrum";

//props used by SuperSpectrum
<SuperSpectrum
  currentColor="#cd87d4" // Pass the current color to be shown on color picker from parent component
  onChange={(color) => setColor(color)} // Pass a callback function to this prop in order to store the color requried from the color picker
  layout="popup" // Choose between inline or popup layout
  hidePopup={() => showPicker(false)} // This Prop hides the popup when close button is clicked. Pass a function in order to make the color picker disappear along with closing the popup
/>;

| Parameter | Type | Description | | :------------------------- | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | currentColor | string | Required. Provide the color as as string from the parent Component either in hexcode or rgb format. Important Supported formats include 3 digit hexcode or 6 digit hexcode or rgb or rgba. Ex : "#642001", rgb(200,100,30), rgba(100,224,200,0.5) | | onChange | function | Required. Handler function to store the color in the parent component. This function gets called everytime color changes in the component Provide a function. Ex : (color) => setColor(color) | | layout | string | Optional. If the color picker needs to be shown as a popup, pass the string "popup" to this prop. | | hidePopup | function | Optional. This prop is to hide the popup and color picker if the layout is of popup type. Important This prop is required if the layout chosen is popup type. | | showCloseButton | boolean | Optional. This prop will show or hide the close button on the color picker when the layout is set to popup. By default it is false. | | customStyles | object | Optional. This prop can take custom styles if they are passed in an object. | | disableTransparentOption | boolean | Optional. This prop is used to show or hide the transparent option. It has a default value set to false. |

Example

import { useState } from "react";
import SuperSpectrum from "super-spectrum";
import React from "react";
import "./app.css";

const App = () => {
  const [myColor, setColor] = useState("#7c0689");
  const [openPicker, setOpenPicker] = useState(true);

  const handleColorChange = (color) => {
    setColor(color);
  };

  return (
    <>
      <div className="app">{openPicker && <SuperSpectrum currentColor={myColor} onChange={handleColorChange} />}</div>
    </>
  );
};

export default App;