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 🙏

© 2024 – Pkg Stats / Ryan Hefner

palette-aldente

v1.14.0

Published

A collection of color palettes

Downloads

15

Readme

Palette Aldente 🍝

github sponsor count npm version

Introducing the ultimate color palette companion: Palette Aldente [alˈdɛnte]! Curate your favorite color schemes and share them effortlessly.

  • Makes sure your yml or json is actually valid
  • Exports it to JSON
  • Provides a handy JS wrapper that works everyhere. (Node, Browser, Codepen etc..)
  • Exports a static SVG of all the palettes
  • Exports PNG images of each palette.
  • Provides a HTML templete with all the palletes. (Ideal for github pages)
  • Ability to name your colors and palettes automatically
  • Coverts almost any color format to any other.
  • Possibility to additionally convert to different color formats: lab, lch, oklab, hsl, etc...
  • Exports Palettes for Photoshop, Illustrator, Gimp, Sketch whatever you can dream of.

Open-sourcing your color palettes allows others to use and improve them, helps build your design expertise, and fosters collaboration within the community. This tool was built to make the process as easy and streamlined as possible.

Palette Aldente Flow Diagram

Quickstart

npx palette-aldente ./src/palettes.yml --formats name,rgb,hsl --namelist bestOf --palettefiles ase

Use to publish your palettes

  1. npm install palette-aldente --save-dev
  2. Create a json or yml file containing your colors.
  3. Edit your package.json to build your actual palette ex:
//...
"scripts": {
    "build": "palette-aldente ./yourcolors.json",
}
  1. npm run build to build the project.
  2. Find your build in the dist/ folder.
  3. Optionally use this workflow to automatically publish all changes to github pages.

CLI Manual

$ npx palette-aldente ./mypalettes.yml 
$ palette-aldente --help

Usage: palette-aldente [options] <file>
Usage: palette-aldente [options] <file>

CLI to manage color palettes

Arguments:
  file                          path to input yaml or json file

Options:
  -V, --version                 output the version number
  -O, --out <directory>         path to output directory (default: "./dist")
  -A, --autoname <boolean>      if true, the palette name will be generated from the colors contained (default: true)
  --no-autoname                 unnamed palettes will be have "Untitled <n>" as name
  -F, --formats <string>        comma separated list of formats to convert to
  -D, --defaultformat <string>  default color format outputted in your target file (default: "hex")
  -N, --namelist <string>       specify color name list to use to name colors on export (default: "bestOf")
  -S, --svg <boolean>           export an overview SVG of the palettes (default: true)
  --no-svg                      do not export an overview SVG of the palettes
  -J, --js <boolean>            export a JS wrapper file with the palettes an a minimal API (default: true)
  --no-js                       do not export an JS file
  -H, --html <boolean>          export a HTML file that showcases the palettes (default: true)
  --no-html                     do not export an HTML file
  -I, --img <boolen>            export PNG images of the palettes (default: true)
  --no-img                      do not export PNG images of the palettes
  -P, --palettefiles <string>   comma separated list of palette files to export (default: false)
  -h, --help                    display help for command

A collection of color palettes I want to reuse. Feel free to clone this and use it to create your own palette library

Build

  1. Edit your palettes in palettes.yml
  2. Install all things that are needed to build your palette. (npm ci)
  3. Run npm run build (Check the console output for eventual error)
  4. Enjoy your files in the dist/ folder

Use

To use this in your JS code import or include dist/palettes.js. It exposes the following props:

  • palettes an array of objects containing name (string with the palette name) and colors (an array of hex values as strings)
  • get(paletteName) will return an object of the palete with a given name
  • random() returns a random palette
  • addPalettes(object) merges in new palettes

Publish

Github Pages

By default, palette-aldente exports an HTML file that you can publish on github pages. To do so automaically whenevery you edit your palette file, you can copy (this workflow](https://github.com/meodai/palette-aldente/blob/main/.github/workflows/node.js.yml) to your own .github/workflows/ directory or simply use the "actions" tab on your repository.

After the workflow successfully passed, make sure to turn on "Pages" in your github repository (settings > pages).

NPM

If you want to reuse your palettes in ofther prjects you might want to use NPM to publush them. Just add the following to your package.json

  "main": "dist/palettes.js",
  "type": "module",
  "exports": {
    "import": "./dist/palettes.esm.js",
    "require": "./dist/palettes.js"
  },

after that you can import your palettes easily:

import { colorPalettes } from "omorovdcolors"; 
// or
import { colorPalettes } from "https://cdn.skypack.dev/[email protected]";

Used by

York Town Hall Colors

Example PNG Export

List of Palettes as PNG

Example SVG Export

List of Palettes as SVG