colorParse.js 360 B

12345678910111213141516
  1. var Benchmark = require('benchmark');
  2. var colorUtil = require('../lib/tool/color');
  3. new Benchmark.Suite()
  4. .add('Color mapping', function () {
  5. colorUtil.parse('#313695');
  6. })
  7. .on('error', function (e) {
  8. console.log(e);
  9. })
  10. .on('cycle', logCycle)
  11. .run();
  12. function logCycle(event) {
  13. console.log(String(event.target));
  14. }