Add color preview

pull/3/head
Amio 2018-06-23 11:20:45 +08:00
rodzic 39dceaba89
commit 3ad7df87f3
1 zmienionych plików z 31 dodań i 6 usunięć

Wyświetl plik

@ -4,24 +4,49 @@ Fast, handcraft, pure JavaScript badge generator.
## Usage
### Micro Service
### Badge Service
`https://badgen.now.sh/badge/:subject/:status/:color`
- `subject` Text
- `status` Text
- `color` RGB color (default '3C1')
- `color` Color RGB (default '3C1') or Color Preset (`green`, `yellow`, ...see below)
Color Presets:
![](https://badgen.now.sh/badge/color/green/green)
![](https://badgen.now.sh/badge/color/yellow/yellow)
![](https://badgen.now.sh/badge/color/orange/orange)
![](https://badgen.now.sh/badge/color/red/red)
![](https://badgen.now.sh/badge/color/pink/pink)
![](https://badgen.now.sh/badge/color/purple/purple)
![](https://badgen.now.sh/badge/color/blue/blue)
![](https://badgen.now.sh/badge/color/grey/grey)
![](https://badgen.now.sh/badge/color/black/black)
Examples:
Examples:
| Preview | URL |
| --- | --- |
|![](https://badgen.now.sh/badge/build/passing) | https://badgen.now.sh/badge/build/passing |
|![](https://badgen.now.sh/badge/style/standard/f2a) | https://badgen.now.sh/badge/style/standard/f2a |
|![](https://badgen.now.sh/badge/license/Apache-2.0/07C) | https://badgen.now.sh/badge/license/Apache-2.0/07C |
|![](https://badgen.now.sh/badge/license/Apache-2.0/blue) | https://badgen.now.sh/badge/license/Apache-2.0/blue |
|![](https://badgen.now.sh/badge/platform/ios%20%7C%20osx%20%7C%20tvos%20%7C%20watchos/grey) | https://badgen.now.sh/badge/platform/ios%20%7C%20osx%20%7C%20tvos%20%7C%20watchos/grey |
### As npm package
```npm install badgen```
### Programmatically
`npm install badgen`
```javascript
const badgen = require('badgen')
const svgString = badgen({
subject: 'npm',
status: 'v1.2.3',
color: 'blue'
})
```
## License