Skip to content

Instantly share code, notes, and snippets.

@gka
Created December 11, 2018 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gka/d78b5ae1b2a79a35c6499f2ef4f970e4 to your computer and use it in GitHub Desktop.
Save gka/d78b5ae1b2a79a35c6499f2ef4f970e4 to your computer and use it in GitHub Desktop.
Quick demo of using only parts of chroma.js
require('chroma-js/src/io/hex');
require('chroma-js/src/io/lab');
const chroma = require('chroma-js/src/chroma');
console.log(chroma('#cc7d8e').lab());
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"build": "rollup -c"
},
"dependencies": {
"chroma-js": "^2.0.0"
},
"devDependencies": {
"rollup": "^0.67.4"
}
}
import resolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
module.exports = {
input: 'index.js',
output: {
file: `test.js`,
format: 'cjs',
},
plugins: [
resolve(),
commonjs(),
]
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment