Skip to content

Commit

Permalink
0.5.3
Browse files Browse the repository at this point in the history
Close #13
  • Loading branch information
MoOx committed Jun 2, 2015
1 parent ce5ee4b commit c05e34e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 75 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,4 @@
# 0.5.3 - 2015-06-02

- Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]`
([#15](https://github.com/harthur/color-convert/issues/15))
44 changes: 0 additions & 44 deletions Gruntfile.js

This file was deleted.

25 changes: 11 additions & 14 deletions README.md
@@ -1,7 +1,7 @@
# color-convert [![Build Status](https://travis-ci.org/harthur/color-convert.svg?branch=master)](https://travis-ci.org/harthur/color-convert)
Color-convert is a color conversion library for JavaScript and node. It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, and CSS keywords:

```javascript
```js
var converter = require("color-convert")();

converter.rgb(140, 200, 100).hsl() // [96, 48, 59]
Expand All @@ -11,20 +11,15 @@ converter.keyword("blue").rgb() // [0, 0, 255]

# Install

### node

For [node](http://nodejs.org) with [npm](http://npmjs.org):

npm install color-convert

### browser

Download the latest [color-convert.js](http://github.com/harthur/color-convert/tree/gh-pages). All the methods are on the `colorConvert` object.
```console
npm install color-convert
```

# API

Color-convert exports a converter object with getter/setter methods for each color space. It caches conversions:

```javascript
```js
var converter = require("color-convert")();

converter.rgb(140, 200, 100).hsl() // [96, 48, 59]
Expand All @@ -35,26 +30,28 @@ converter.rgb([140, 200, 100]) // args can be an array
### Plain functions
Get direct conversion functions with no fancy objects:

```javascript
```js
require("color-convert").rgb2hsl([140, 200, 100]); // [96, 48, 59]
```

### Unrounded
To get the unrounded conversion, append `Raw` to the function name:

```javascript
```js
convert.rgb2hslRaw([140, 200, 100]); // [95.99999999999999, 47.619047619047606, 58.82352941176471]
```

### Hash
There's also a hash of the conversion functions keyed first by the "from" color space, then by the "to" color space:

```javascript
```js
convert["hsl"]["hsv"]([160, 0, 20]) == convert.hsl2hsv([160, 0, 20])
```

### Other spaces

There are some conversions from rgb (sRGB) to XYZ and LAB too, available as `rgb2xyz()`, `rgb2lab()`, `xyz2rgb()`, and `xyz2lab()`.

# Contribute

Please fork, add conversions, figure out color profile stuff for XYZ, LAB, etc. This is meant to be a basic library that can be used by other libraries to wrap color calculations in some cool way.
3 changes: 0 additions & 3 deletions browser.js

This file was deleted.

16 changes: 8 additions & 8 deletions component.json
@@ -1,9 +1,9 @@
{
"name": "color-convert",
"description": "Plain color conversion functions",
"version": "0.3.3",
"author": "Heather Arthur <fayearthur@gmail.com>",
"repository": "harthur/color-convert",
"keywords": ["color", "colour", "rgb"],
"scripts": ["index.js", "conversions.js"]
}
"name": "color-convert",
"description": "Plain color conversion functions",
"version": "0.5.3",
"author": "Heather Arthur <fayearthur@gmail.com>",
"repository": "harthur/color-convert",
"keywords": ["color", "colour", "rgb"],
"scripts": ["index.js", "conversions.js"]
}
7 changes: 1 addition & 6 deletions package.json
@@ -1,18 +1,13 @@
{
"name": "color-convert",
"description": "Plain color conversion functions",
"version": "0.5.2",
"version": "0.5.3",
"author": "Heather Arthur <fayearthur@gmail.com>",
"repository": {
"type": "git",
"url": "http://github.com/harthur/color-convert.git"
},
"main": "./index",
"devDependencies": {
"browserify": "^6.1.0",
"uglify-js": "1.0.x",
"grunt": "^0.4.5",
"grunt-contrib-uglify": "^0.6.0"
},
"scripts": {
"test": "node test/basic.js"
Expand Down

0 comments on commit c05e34e

Please sign in to comment.