diff --git a/badge-maker/lib/make-badge.js b/badge-maker/lib/make-badge.js index 5bd9aa4bf9..78f83d5838 100644 --- a/badge-maker/lib/make-badge.js +++ b/badge-maker/lib/make-badge.js @@ -23,17 +23,16 @@ module.exports = function makeBadge({ const [label, message] = text - color = normalizeColor(color) - labelColor = normalizeColor(labelColor) - // This ought to be the responsibility of the server, not `makeBadge`. if (format === 'json') { return JSON.stringify({ label, message, logoWidth, - color, - labelColor, + // Only call normalizeColor for the JSON case: this is handled + // internally by toSvgColor in the SVG case. + color: normalizeColor(color), + labelColor: normalizeColor(labelColor), link: links, name: label, value: message,