badgen
Advanced tools
Comparing version 1.2.0 to 2.0.0
module.exports = { | ||
green: '3C1', | ||
blue: '08C', | ||
red: 'D52', | ||
red: 'E42', | ||
yellow: 'DB1', | ||
orange: 'F73', | ||
purple: 'A3E', | ||
pink: 'E48', | ||
pink: 'E59', | ||
grey: '999', | ||
cyan: '4BA' | ||
} |
const calcWidth = require('./calc-text-width.js').Verdana11 | ||
const colorPresets = require('./color-presets.js') | ||
module.exports = function ({subject, status, color}, opts = {}) { | ||
module.exports = function ({subject, status, color, style}) { | ||
color = colorPresets[color] || color || colorPresets['blue'] | ||
@@ -11,4 +11,2 @@ | ||
const { style } = opts | ||
if (style === 'flat') { | ||
@@ -34,3 +32,3 @@ return ` | ||
<linearGradient id="a" x2="0" y2="100%"> | ||
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/> | ||
<stop offset="0" stop-color="#EEE" stop-opacity=".1"/> | ||
<stop offset="1" stop-opacity=".1"/> | ||
@@ -37,0 +35,0 @@ </linearGradient> |
{ | ||
"name": "badgen", | ||
"version": "1.2.0", | ||
"version": "2.0.0", | ||
"description": "Fast svg badge generator.", | ||
@@ -5,0 +5,0 @@ "author": "Amio <amio.cn@gmail.com>", |
@@ -16,3 +16,2 @@ # badgen [![npm-version][npm-badge]][npm-link] [![install size][pp-badge]][pp-link] | ||
const badgen = require('badgen') | ||
const options = { style: 'flat' } | ||
@@ -23,3 +22,4 @@ const svgString = badgen({ | ||
color: 'blue' // <Color RGB> or <Color Name>, optional | ||
}, options) // options is optional | ||
style: 'flat' // 'flat' or undefined, optional | ||
}) | ||
``` | ||
@@ -26,0 +26,0 @@ |
6045
81