Socket
Socket
Sign inDemoInstall

iwanthue-api

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    iwanthue-api

API for iWantHue, a palette generator for scientists


Version published
Maintainers
1
Install size
42.3 kB
Created

Readme

Source

iWantHue API

iWantHue is a palette generator for scientists. This module intends to be a handy port of the original tool for inclusion in other projects.

iWantHue...to want...me!

Installation

Install iWantHueAPI with npm:

npm install iwanthue-api

Example

var iWantHue = require('iwanthue-api');

// Generate a color palette
var colors = iWantHue().generate(
  7,                   // Number of colors to generate
  function(color){     // This function filters valid colors...
    var hcl = color.hcl();
    return hcl[0]>=0 && hcl[0]<=360 && // ...for a specific range of hues
           hcl[1]>=0 && hcl[1]<=3 &&
           hcl[2]>=0 && hcl[2]<=1.5;
  },
  false,               // Use Force Vector (for k-Means, use true)
  50                   // Color steps (quality)
);

// Sort colors by differentiation
var sortedColors = iWantHue().diffSort(colors);

iWantHue Theory

iWantHue aims to distributing colors evenly, in a perceptively coherent space, constrained by user-friendly settings, and to generate high quality custom palettes.

More can be found here.

Original tool

If you're looking for the original tool, and a ton of great information, visit http://tools.medialab.sciences-po.fr/iwanthue/index.php.

FAQs

Last updated on 29 Apr 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc