extract the algorithm into its own library and publish to NPM
See original GitHub issueHello,
your application is really useful !
Would it be possible to extract the algorithm into its own library so we can use it directly from our projects ?
Something like :
import mcg from 'mcg'
const palette = mcg('#fefefe') // returns the object with all the generated colors
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Steps to Create and Publish NPM packages - GeeksforGeeks
In this article, we will learn how to develop and publish your own npm package (also called an NPM module). There are many...
Read more >Learn How to Develop and Publish an NPM Package - Auth0
Check out this NPM developer's practical tutorial. Learn what tools we can leverage to develop and publish high-quality NPM packages.
Read more >How to Build and Publish NPM packages with Webpack
To publish the code, open a terminal and navigate to the root folder of your project. ... Before this, be sure that you...
Read more >How to publish a npm package in four steps
A step by step tutorial on how to publish a package on npm using compact and idiomatic JavaScript.
Read more >How to Create and Publish a React Component Library
This tutorial will take you through the process of creating and publishing your own custom React component library and hosting it on Github....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
While I am not offering an NPM package specifically, I am going to close this issue for now. It’s not necessarily an issue relevant to this particular repository.
That being said, the primary tool used in determining our colors is actually the tinycolor repo.
So, if you need to generate these palettes dynamically, first run:
npm install tinycolor2
Once you have tinycolor setup, simply use the following to generate the array you’re looking for:
Now, you can simply generate any palette you’d like using the originally requested JS snippet:
const palette = mcg('#fefefe')
@jacarma @jgoux I realize this is like two years late, but I just published a quick sass adaptation of the core logic for the palette generation. I’ll finish up the javascript library a little later and let you guys know…even though there is probably not a use case anymore 😅