Closed mathiasbynens closed 10 years ago
I modified your format a bit. The minimum required is the following:
"build-passed": {
/* Textual information shown, in order. */
"text": [ "build", "passed" ],
/* Width of the first box, width of the second box. */
"widths": [ 33, 44 ],
/* Gradient of the background color of the second box. */
"colorB": [ "#8f6", "#4c1", "#3b0", "#370" ]
}
I’d still prefer referring to a color scheme name rather than hardcoding the colors in the file, as color schemes are likely to be re-used with different text. Or am I missing something?
Where would we define the color schemes? In a different file?
Are there two distinct badges with the same color scheme in the wild?
Where would we define the color schemes? In a different file?
Yeah, or maybe in the same file in a separate property at the top? Something like:
{
"color-schemes": { … },
"badges": { … }
}
Are there two distinct badges with the same color scheme in the wild?
Sure, e.g. https://github.com/mathiasbynens/he#readme has these (from two different services!):
https://github.com/svg/svgo#svgo---- has:
Ironically, it uses a different gradient!
This repository will mainly host the template on which the SVG badges are used.
But we’ll want to create several badges with different settings:
It would be cool if, whenever we make changes to the main template, the various badges can be updated just by running a build script.
I’m thinking: a JSON config file that contains settings for each badge (incl. width for each part of the badge as well as the name of the gradient/color combination that should be used). So, for each badge, there would be an entry like this:
Any other ideas?