Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,17 @@ chroma.lch(80, 40, 130);
chroma(80, 40, 130, 'lch');
```

When round-tripping colors through `Lab` or `Lch`, keep the same Lab white
point for the whole conversion chain. Chroma.js uses D65 by default, while some
other color tools and CSS Color 4 examples use D50. Mixing those assumptions can
produce visibly different RGB results, even if the `Lch` values themselves have
not been intentionally changed. If you need to match another tool, set the Lab
white point explicitly before converting:

```js
chroma.setLabWhitePoint('D50');
```

### chroma.hcl
#### (hue, chroma, lightness)

Expand Down Expand Up @@ -414,6 +425,7 @@ chroma
.colors(5);
```


Of course you can also just construct the scale from the official 5-step colors that you can copy and paste from [colorbrewer2.org](https://colorbrewer2.org/#type=diverging&scheme=RdBu&n=5):

```js
Expand Down Expand Up @@ -1095,5 +1107,3 @@ chroma.cubehelix()
.correctLightness()
.colors(5);
```