# opencolor

> A collection of functions to parse Open Color files, construct them via code and write them

Latest version **0.2.0** (published 2022-06-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install opencolor
pnpm add opencolor
yarn add opencolor
bun add opencolor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-06-22 |
| First published | 2016-04-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Jan Krutisch |
| Maintainers | halfbyte |
| Keywords | colors, palettes, parsing |

## Links

- npm: https://www.npmjs.com/package/opencolor
- Repository: https://github.com/opencolor-tools/opencolor-js
- Homepage: http://opencolor.tools
- Issues: https://github.com/opencolor-tools/opencolor-js/issues
- npm.io page: https://npm.io/package/opencolor

## Dependencies (1)

- [tinycolor2](https://npm.io/package/tinycolor2.md) ^1.3.0

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.2.0 (latest) — 2016-06-22
- 0.1.0 — 2016-06-16
- 0.0.8 — 2016-05-06
- 0.0.7 — 2016-04-27
- 0.0.6 — 2016-04-27
- 0.0.5 — 2016-04-22
- 0.0.4 — 2016-04-22
- 0.0.3 — 2016-04-22
- 0.0.2 — 2016-04-20
- 0.0.1 — 2016-04-08

## README

# Open Color Library

A node module to parse, render and interpret Open Color Format.

Build Status: [![Build Status](https://travis-ci.org/opencolor-tools/opencolor-js.svg?branch=master)](https://travis-ci.org/opencolor-tools/opencolor-js)

[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)


## Install

npm install opencolor

## Examples

### Parsing and rendering OCO formats.

```javascript
var oco = require('opencolor');

var tree = oco.parse(string); // gives you a tree of the parsed OCO data

var out = oco.render(tree); // outputs a valid oco file of the tree
```

### Creating OCO programmatically

```javascript
var oco = require('opencolor');

 // creates a root object
var tree = new oco.Entry();

// create a named color from a hex color
var color = new oco.Entry('super color', [oco.ColorValue.fromColorValue('#ff0')], 'Color');
var group = new oco.Entry('group', [color]);
// set some metadata on the group
group.addMetadata({'author/name': 'Jan Krutisch'});
tree.addChild(group);

var out = oco.render(tree); // outputs a valid oco file of the tree
```

We're going to add more thorough Documentation soon!

## Development

```
git clone https://github.com/opencolor-tools/opencolor-js.git
npm install
npm run test:watch
```

---
_Source: https://npm.io/package/opencolor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
