https://github.com/jutaz/js-swatches
🎨 JS swatch library
https://github.com/jutaz/js-swatches
colors css-in-js javascript npm-package swatches
Last synced: 30 days ago
JSON representation
🎨 JS swatch library
- Host: GitHub
- URL: https://github.com/jutaz/js-swatches
- Owner: jutaz
- Created: 2018-06-23T04:58:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-06-23T13:13:47.000Z (almost 7 years ago)
- Last Synced: 2025-04-19T07:50:20.615Z (about 1 month ago)
- Topics: colors, css-in-js, javascript, npm-package, swatches
- Language: JavaScript
- Size: 165 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
## Color swatches
A silly project that exports each color as it's own package under `@swatch` scope on npm. Example usage:
`npm install --save @swatch/crimson`
```js
const {hex} = require('@swatch/crimson');instance.setBackgroundColor(hex);
```Also exposes `string` sub-package for string version of these colors:
```js
const {hex} = require('@swatch/crimson/string');document.body.style.backgroundColor = hex;
```## Supported formats
List of all supported color formats.
### As raw values
- `hsl`
- `hsv`
- `hwb`
- `cmyk`
- `xyz`
- `lab`
- `lch`
- `hex`
- `keyword`
- `ansi16`
- `ansi256`
- `hcg`
- `apple`
- `gray`### As string values
- `rgb`
- `hsl`
- `hex`