Skip to content

Instantly share code, notes, and snippets.

@gka gka/index.js
Created Dec 11, 2018

Embed
What would you like to do?
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
You can’t perform that action at this time.