Refactor badge color functions (#2742)

- Replace the idea of color schemes with the idea of named colors (since none of our colorschemes have used `colorA`)
- Pass through the normalized color to `_shields_test` to harmonize with BaseService and simplify testing
    - Update service tests
- Move responsibility for color generation into the npm package
- Remove several color helper functions and their tests
- Update gh-badge public API to accept `color` and `labelColor`

This is a precursor to refactoring some of the logo code for #2473.
This commit is contained in:
Paul Melnikow
2019-01-15 16:43:33 -05:00
committed by GitHub
parent cab689706f
commit 4597d77015
81 changed files with 492 additions and 669 deletions

View File

@@ -63,7 +63,7 @@ module.exports = class GithubForks extends LegacyService {
const data = JSON.parse(buffer)
const forks = data.forks_count
badgeData.text[1] = forks
badgeData.colorscheme = null
badgeData.colorscheme = undefined
badgeData.colorB = '#4183C4'
sendBadge(format, badgeData)
} catch (e) {