diff --git a/lib/color-presets.js b/lib/color-presets.js new file mode 100644 index 0000000..4fd519f --- /dev/null +++ b/lib/color-presets.js @@ -0,0 +1,11 @@ +module.exports = { + green: '3C1', + blue: '08C', + red: 'D52', + yellow: 'DB1', + orange: 'F73', + purple: 'A3E', + pink: 'E48', + grey: '999', + black: '000' +} diff --git a/lib/index.js b/lib/index.js index 42c8198..f9ff75a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,9 @@ const calcWidth = require('./calc-text-width.js').Arial12 +const colorPresets = require('./color-presets.js') + +module.exports = function ({subject, status, color}) { + color = colorPresets[color] || color || colorPresets['green'] -module.exports = function ({subject, status, color = '3C1'}) { // const charWidth = 7.3 const calcFactor = 0.4