https://github.com/thebespokepixel/palette2oco
Load or convert directories of various pallete files to structured Open Color data or .oco files.
https://github.com/thebespokepixel/palette2oco
color color-palette node-module npm oco open-color
Last synced: 3 months ago
JSON representation
Load or convert directories of various pallete files to structured Open Color data or .oco files.
- Host: GitHub
- URL: https://github.com/thebespokepixel/palette2oco
- Owner: thebespokepixel
- License: mit
- Created: 2016-09-24T17:28:31.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2025-02-14T08:11:19.000Z (over 1 year ago)
- Last Synced: 2025-10-11T19:33:50.792Z (8 months ago)
- Topics: color, color-palette, node-module, npm, oco, open-color
- Language: JavaScript
- Size: 27.1 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 19
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# palette2oco converter
> Load or convert files or directories of various palette formats to structured Open Color data or .oco files.
##### Publishing Status
[](https://www.npmjs.com/package/@thebespokepixel/palette2oco "npm") [](https://libraries.io/github/thebespokepixel/palette2oco "Libraries.io")
[](https://travis-ci.com/thebespokepixel/palette2oco "Travis") [](https://github.com/rollup/rollup/wiki/pkg.module "Rollup")
##### Development Status
[](https://travis-ci.com/thebespokepixel/palette2oco "Travis") [](https://libraries.io/github/thebespokepixel/palette2oco "Libraries.io")
[](https://snyk.io/test/github/thebespokepixel/palette2oco "Snyk") [](https://codeclimate.com/github/thebespokepixel/palette2oco/maintainability "Code-Climate") [](https://codeclimate.com/github/thebespokepixel/palette2oco/test_coverage "Code-Climate Coverage")
##### Documentation/Help
[](https://inch-ci.org/github/thebespokepixel/palette2oco "Inch.io") [](https://twitter.com/thebespokepixel "Twitter")
## Usage
#### Load structured palette data from various tools into Open Color format.
```js
import {paletteReader, paletteWriter, oco2Object, oco2Vars} from 'palette2oco'
paletteReader(pathRoot).load(pathArray)
.then(palette => palette.render(ocoPath))
.then(oco => paletteWriter(destinationFile, oco))
.catch(err => {
console.error(err)
})
```
#### Convert palette data from a variety of sources into Open Color .oco format.
Allows structured directories of pallette data to be converted into nested oco palette data.
##### Formats supported:
- Sip (http://sipapp.io): Supports .sippalette and .json exports.
- Abobe Swatch Exchange (ASE): Full support of RGB, CMYK and Lab colorspaces.
- Vanilla JSON: File signature must match the following...
```js
{
"name" : "Palette name",
"colors" : [
{
name: "Color name",
red: (0.0 - 1.0 | 0 - 255)
green: (0.0 - 1.0 | 0 - 255)
blue: (0.0 - 1.0 | 0 - 255)
alpha: (0.0 - 1.0 | 0 - 255)
}
...
]
}
```
## Documentation
Full documentation can be found at [https://thebespokepixel.github.io/palette2oco/][1]
[1]: https://thebespokepixel.github.io/palette2oco/