Comparing hard-coded style values of Badge 1.9.1 to Badge 1.10 which introduced CSS styles (and unfortunately lost the style contents, as pursued in that referenced issue), I think it makes sense for both Badge and Groovy PostBuild plugins to extend the possible parameters of their addShortText() methods with a new option (keeping legacy code for colors/borders intact) to set a CSS style name instead-of/additionally-to those legacy values, with the Jenkins deployment free to define such style in the custom CSS file at $JENKINS_HOME/userContent/something.css linked in controller's configuration.
So instead of hard-coding color and thickness numbers in my call, I'd tell addShortText to, for example, add a style="badge-error" to the list of styles for the entry (built-in ones being fallback for un-customized values). There would be less HTML mark-up generated, and the site design would be more future-proof (or theme-proof) thanks to CSS.
[{"id":-1,"name":"My open issues","jql":"assignee = currentUser() AND resolution = Unresolved order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":true},{"id":-2,"name":"Reported by me","jql":"reporter = currentUser() order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":true},{"id":-4,"name":"All issues","jql":"order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-5,"name":"Open issues","jql":"resolution = Unresolved order by priority DESC,updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-9,"name":"Done issues","jql":"statusCategory = Done order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-3,"name":"Viewed recently","jql":"issuekey in issueHistory() order by lastViewed DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-6,"name":"Created recently","jql":"created >= -1w order by created DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-7,"name":"Resolved recently","jql":"resolutiondate >= -1w order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false},{"id":-8,"name":"Updated recently","jql":"updated >= -1w order by updated DESC","isSystem":true,"sharePermissions":[],"requiresLogin":false}]