Skip to content

Commit 6b7dee5

Browse files
Jimmy WärtingQix-
authored andcommitted
Update readme
1 parent c1576fe commit 6b7dee5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ Color-convert is a color conversion library for JavaScript and node.
44
It converts all ways between `rgb`, `hsl`, `hsv`, `hwb`, `cmyk`, `ansi`, `ansi16`, `hex` strings, and CSS `keyword`s (will round to closest):
55

66
```js
7-
var convert = require('color-convert');
7+
import convert from 'color-convert';
88

99
convert.rgb.hsl(140, 200, 100); // [96, 48, 59]
1010
convert.keyword.rgb('blue'); // [0, 0, 255]
1111

12-
var rgbChannels = convert.rgb.channels; // 3
13-
var cmykChannels = convert.cmyk.channels; // 4
14-
var ansiChannels = convert.ansi16.channels; // 1
12+
const rgbChannels = convert.rgb.channels; // 3
13+
const cmykChannels = convert.cmyk.channels; // 4
14+
const ansiChannels = convert.ansi16.channels; // 1
1515
```
1616

1717
# Install
1818

19-
```console
19+
```sh
2020
$ npm install color-convert
2121
```
2222

@@ -29,7 +29,7 @@ All functions have a rounded and unrounded variant. By default, return values ar
2929
All 'from' functions have a hidden property called `.channels` that indicates the number of channels the function expects (not including alpha).
3030

3131
```js
32-
var convert = require('color-convert');
32+
import convert from 'color-convert';
3333

3434
// Hex to LAB
3535
convert.hex.lab('DEADBF'); // [ 76, 21, -2 ]
@@ -46,7 +46,7 @@ All functions that accept multiple arguments also support passing an array.
4646
Note that this does **not** apply to functions that convert from a color that only requires one value (e.g. `keyword`, `ansi256`, `hex`, etc.)
4747

4848
```js
49-
var convert = require('color-convert');
49+
import convert from 'color-convert';
5050

5151
convert.rgb.hex(123, 45, 67); // '7B2D43'
5252
convert.rgb.hex([123, 45, 67]); // '7B2D43'

0 commit comments

Comments
 (0)