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

less-plugin-cubehelix

v0.0.1

Published

cubehelix plugin for less.js

Downloads

159

Readme

Cubehelix plugin for Less

Dave Green's `cubehelix' colour scheme is intended to be perceived as increasing in intensity. This goes from black to white, deviating away from a pure greyscale (i.e. the diagonal from black to white in a colour cube) using a tapered helix in the colour cube, while ensuring a continuous increase in perceived intensity. The deviation from the diagonal takes into account that red, green and blue are not perceived equally in terms of intensity. This colour scheme prints as a monotonically increasing greyscale on black and white postscript devices.

Mike Bostock has implemented and extended cubehelix in JavaScript as a plugin for the D3.js visualisation library (see examples), the plugin uses Bostock's JavaScript implementation to extend Less with a cubehelix function.

The cubehelix(y,a,b,t) function returns a color between the two colors a and b, using a gamma correction value of 1. The two colors are typically specified in HSL color space, for starting hue angle 0 < y <= 1 and ending hue angle 0 < t <= 1.

lessc usage

npm install -g less-plugin-cubehelix

and then on the command line,

lessc file.less --cubehelix

Then the following Less code:

p{color: cubehelix(1,red,blue,1);}
p{color: cubehelix(1,red,blue,0.5);}
p{color: cubehelix(1, hsl(300,50%,0%), hsl(-240,50%,100%), 0.3);}

outputs:

p {
  color: #766cfd;
}
p {
  color: #21ba40;
}
p {
  color: #4c4c4c;
}

Programmatic usage

var LessPluginCubehelix = require('less-plugin-cubehelix'),
    CubehelixPlugin = new LessPluginCubehelix();
less.render(lessString, { plugins: [CubehelixPlugin] })
  .then(

Browser usage

Download index.js and use it as follows:

<script src="index.js"></script>
<script>
less = { 
    plugins: [cubehelix]
};
</script>  
<script src="//cdnjs.cloudflare.com/ajax/libs/less.js/2.1.0/less.min.js"></script>