All files / cjs color.js

100% Statements 5/5
100% Branches 4/4
100% Functions 2/2
100% Lines 5/5
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22    2x     2x                     6x 3x   3x    
'use strict';
 
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = color;
/**
 * color
 * @module color
 * @description get a color from your color palette
 * @author Zander
 * @example: color(colorPalette)('bright', 'lighter')
 * @param {object} palette
 * @return {string}
 */
function color(palette) {
  return function (hue) {
    var value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'base';
 
    return palette[hue][value];
  };
}