Add save svg-badge directly to gist

This adds the posibility of saving an SVG badge generated by the same
shields.io dirictly to the gist. Instead of prepering a JSON file to
be sent to their service, we use their library directly, which outputs
an SVG file that we can save to the user’s gist.

Filenames ending in `.svg` will use this library automatically.

Additionally there is a major refactoring where the older `node:http`
library has been swapped out for `fetch`.

Also swap from node 16 to node 20

fixes #24
This commit is contained in:
Rúnar Berg
2023-09-26 17:37:34 -07:00
parent b7809ee0af
commit a2d3829b14
63 changed files with 4632 additions and 137 deletions

92
node_modules/css-color-converter/README.md generated vendored Normal file
View File

@@ -0,0 +1,92 @@
# css-color-converter [![Build Status][ci-img]][ci]
Converts CSS colors from one representation to another
[ci-img]: https://travis-ci.org/andyjansson/css-color-converter.svg
[ci]: https://travis-ci.org/andyjansson/css-color-converter
## Installation
```js
npm install css-color-converter
```
## Usage
**Example usage**:
```js
import { fromString } from 'css-color-converter';
fromString('rgb(255, 255, 255)').toHslString(); // hsl(0, 0%, 100%)
fromString('rgba(255, 255, 255, 0.5)').toHslString(); // hsla(0, 0%, 100%, 0.5)
fromString('blue').toRgbString(); // rgb(0, 0, 255)
fromString('red').toHexString(); // #ff0000
```
## Functions
### `fromString(str)`
| parameter | type | description |
| --------- | ------ | ---------------------------------------------- |
| `str` | string | Supports named colors, hex, rgb/rgba, hsl/hsla |
**Returns** [`instance`](#Methods) if valid, `null` if invalid.
### `fromRgb([r, g, b])`
| parameter | type | description |
| --------- | ------ | ------------- |
| `r` | int | red (0-255) |
| `g` | int | green (0-255) |
| `b` | int | blue (0-255) |
**Returns** [`instance`](#Methods)
### `fromRgba([r, g, b, a])`
| parameter | type | description |
| --------- | ------ | ------------- |
| `r` | int | red (0-255) |
| `g` | int | green (0-255) |
| `b` | int | blue (0-255) |
| `a` | float | alpha (0-1) |
**Returns** [`instance`](#Methods)
### `fromHsl([h, s, l])`
| parameter | type | description |
| --------- | ------ | ------------------ |
| `h` | int | hue (0-360) |
| `s` | int | saturation (0-100) |
| `l` | int | luminosity (0-100) |
**Returns** [`instance`](#Methods)
### `fromHsla([h, s, l, a])`
| parameter | type | description |
| --------- | ------ | ------------------ |
| `h` | int | hue (0-360) |
| `s` | int | saturation (0-100) |
| `l` | int | luminosity (0-100) |
| `a` | float | alpha (0-1) |
**Returns** [`instance`](#Methods)
## Methods
### `toRgbString()`
**Returns** `rgb()` or `rgba()`, depending on the alpha.
### `toHslString()`
**Returns** `hsl()` or `hsla()`, depending on the alpha.
### `toHexString()`
**Returns** 6-digit or 8-digit `hex`, depending on the alpha.
### `toRgbaArray()`
**Returns** `[r, g, b, a]` array.