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

color-wheel-renderer

v0.1.19

Published

Color Wheel Renderer is a tool for generating custom color wheels.

Downloads

4

Readme

Color Wheel Renderer

Build Status

If you have any problems or suggestions for new features please let me know in an issue.

Installation

npm install -g color-wheel-renderer

License

Color Wheel Renderer is released under the MIT License. See [LICENSE][LICENSE] file for details.

Usage

Each color wheel represents a mapping from the 3D HSL or HSV cylinder to a 2D circle. However this is not limited to a simple slice through the cylinder.

There are four base types of color wheel, two for HSL and two for HSV cylinders. For HSL there is either a fixed lightness or fixed saturation, and for HSV there is either a fixed value or fixed saturation.

In either case, you can specify one or more values for of the fixed variable. Each fixed value will create a new color wheel, or if the --expand option is used it will expand a single color wheel using each value in turn.

You can bucket in either the angular or radial directions using the --angular-buckets and --radial-buckets options.

You can reverse the colors in the radial direction using the --reverse-radial-colors option. This option also automatically reverses the radial bucketing direction from outwards to inwards, however you can also independently reverse the radial bucketing direction with the --reverse-radial-bucketing option.

You can set the diameter of each wheel in pixels using the --diameter option, and add a margin using the --margin option.

> color-wheel-renderer color-wheel --help

Usage: color-wheel [options] <type>

  Renders one or more color wheels. Type can be one of [hsl-fixed-saturation, hsl-fixed-lightness, hsv-fixed-saturation, hsv-fixed-value].

  Options:

    -a --angular-buckets <count>   Number of angular buckets to divide colors into. Defaults to 0, which gives a smooth output.
    -r --radial-buckets <count>    Number of radial buckets to divide colors into. Defaults to 0, which gives a smooth output.
    -f --fixed <number>            Fixed values at which to render. Can be specified multiple times. Defaults to 0.5 for lightness or 1 for saturation and value. (default: )
    -o --output <filePath>         Path to file where color wheel should be saved.
    -d --diameter <pixels>         Diameter of the color wheel in pixels.
    -m --margin <pixels>           Size of margin around color wheel in pixels.
    -e --expand                    Add additional wheels to outside of previous wheel.
    -c --reverse-radial-colors     Reverses the order of colours from the center to edge of the wheel.
    -b --reverse-radial-bucketing  Reverses the direction of radial bucketing from the default. Defaults to outwards, or inwards if colors are reversed.
    --verbose                      Enable verbose logging.
    -h, --help                     output usage information

Examples

HSV Fixed Value

18 Angular Buckets, 12 Radial Buckets, 3 Values

HSV Fixed Value Color Wheel

color-wheel-renderer color-wheel hsv-fixed-value -f 1 -f 0.6 -f 0.2 -a 18 -r 12

HSL Fixed Lightness

18 Angular Buckets, 12 Radial Buckets, 3 Lightness Values

HSL Fixed Lightness Color Wheel

color-wheel-renderer color-wheel hsl-fixed-lightness -f 0.8 -f 0.5 -f 0.2 -a 18 -r 12

HSV Fixed Saturation

18 Angular Buckets, 12 Radial Buckets, 3 Saturation Values

HSV Fixed Saturation Color Wheel

color-wheel-renderer color-wheel hsv-fixed-saturation -f 1 -f 0.6 -f 0.2 -a 18 -r 12

HSL Fixed Saturation

18 Angular Buckets, 12 Radial Buckets, 3 Saturation Values

HSL Fixed Saturation Color Wheel

Note that for this wheel the outermost band is white and therefore only 11 buckets are visible.

color-wheel-renderer color-wheel hsl-fixed-saturation -f 1 -f 0.6 -f 0.2 -a 18 -r 12

HSL Fixed Saturation Smooth

No Bucketing

HSL Fixed Saturation Smooth Color Wheel

color-wheel-renderer color-wheel hsl-fixed-saturation

HSL Fixed Saturation Smooth Reversed Colors

No Bucketing, Reversed Colors

HSL Fixed Saturation Smooth Reversed Color Wheel

color-wheel-renderer color-wheel hsl-fixed-saturation -c

HSL Fixed Saturation Angular Bucketing

36 Angular Buckets

HSL Fixed Saturation Angular Bucketing Color Wheel

color-wheel-renderer color-wheel hsl-fixed-saturation -a 36

HSL Fixed Saturation Radial Bucketing

12 Radial Buckets

HSL Fixed Saturation Radial Bucketing Color Wheel

Note that for this wheel the outermost band is white and therefore only 11 buckets are visible.

color-wheel-renderer color-wheel hsl-fixed-saturation -r 12

HSV Fixed Saturation Expand

12 Angular Buckets, 5 Radial Buckets, 3 Saturation Values, Expand Color Wheel

HSV Fixed Saturation Expand Color Wheel

color-wheel-renderer color-wheel hsv-fixed-saturation -f 0.25 -f 0.5 -f 1 -a 18 -r 12 -e

HSL Fixed Saturation Expand

12 Angular Buckets, 5 Radial Buckets, 3 Saturation Values, Expand Color Wheel, Reverse Bucketing Direction

HSL Fixed Saturation Expand Color Wheel

color-wheel-renderer color-wheel hsl-fixed-saturation -f 0.1 -f 0.5 -f 1 -a 18 -r 12 -e -b

HSV Fixed Saturation Coarse Bucketing

12 Angular Buckets, 5 Radial Buckets

HSV Fixed Saturation Coarse Color Wheel

color-wheel-renderer color-wheel hsv-fixed-saturation -a 12 -r 5

Full Script

The following script generates the exact set of color wheels rendered on this page.

Note that the HSL Fixed Saturation wheels which use radial bucketing have a slightly larger diameter to compensate for the outer bucket being pure white. An alternative to this would be to reverse the radial bucketing direction with the --reverse-radial-bucketing option. This would in turn result in the center circle being pure black, which may or may not be desirable.

color-wheel-renderer color-wheel hsv-fixed-value -f 1 -f 0.6 -f 0.2 -a 18 -r 12 -d 720 -m 40 -o color-wheel-hsv-fixed-value-three.png
color-wheel-renderer color-wheel hsl-fixed-lightness -f 0.8 -f 0.5 -f 0.2 -a 18 -r 12 -d 720 -m 40 -o color-wheel-hsl-fixed-lightness-three.png
color-wheel-renderer color-wheel hsv-fixed-saturation -f 1 -f 0.6 -f 0.2 -a 18 -r 12 -d 720 -m 40 -o color-wheel-hsv-fixed-saturation-three.png
color-wheel-renderer color-wheel hsl-fixed-saturation -f 1 -f 0.6 -f 0.2 -a 18 -r 12 -d 780 -m 10 -o color-wheel-hsl-fixed-saturation-three.png
color-wheel-renderer color-wheel hsl-fixed-saturation -d 720 -m 40 -o color-wheel-hsl-fixed-saturation-smooth.png
color-wheel-renderer color-wheel hsl-fixed-saturation -c -d 720 -m 40 -o color-wheel-hsl-fixed-saturation-smooth-reversed-colors.png
color-wheel-renderer color-wheel hsl-fixed-saturation -a 36 -d 720 -m 40 -o color-wheel-hsl-fixed-saturation-angular.png
color-wheel-renderer color-wheel hsl-fixed-saturation -r 12 -d 780 -m 10 -o color-wheel-hsl-fixed-saturation-radial.png
color-wheel-renderer color-wheel hsv-fixed-saturation -f 0.25 -f 0.5 -f 1 -a 18 -r 12 -e -d 720 -m 40 -o color-wheel-hsv-fixed-saturation-expand.png
color-wheel-renderer color-wheel hsl-fixed-saturation -f 0.1 -f 0.5 -f 1 -a 18 -r 12 -e -b -d 720 -m 40 -o color-wheel-hsl-fixed-saturation-expand.png
color-wheel-renderer color-wheel hsv-fixed-saturation -a 12 -r 5 -d 720 -m 40 -o color-wheel-hsv-fixed-saturation-coarse.png