Created
December 11, 2018 00:03
-
-
Save gka/d78b5ae1b2a79a35c6499f2ef4f970e4 to your computer and use it in GitHub Desktop.
Quick demo of using only parts of chroma.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('chroma-js/src/io/hex'); | |
require('chroma-js/src/io/lab'); | |
const chroma = require('chroma-js/src/chroma'); | |
console.log(chroma('#cc7d8e').lab()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "test", | |
"version": "1.0.0", | |
"main": "index.js", | |
"scripts": { | |
"build": "rollup -c" | |
}, | |
"dependencies": { | |
"chroma-js": "^2.0.0" | |
}, | |
"devDependencies": { | |
"rollup": "^0.67.4" | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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