npm package: @recifs/d3-color-maps-avatar
Description: More color schemes.
Author: Philippe Rivière
Latest version: 1.0.1

# d3-colors-maps

This module provides color <!-- schemes and -->interpolators to complement d3-scale-chromatic.

These <!-- schemes and -->interpolators are designed to work with [d3-scale](https://github.com/d3/d3-scale)’s [d3.scaleSequential](https://github.com/d3/d3-scale#sequential-scales). For example, to create a continuous color scale using the [Berlin](#interpolateBerlin) color interpolator:

```js
var color = d3.scaleSequential(d3.interpolateBerlin);
color(0.25);
```

## Installing

If you use NPM, `npm install d3-colors-maps`. Otherwise, download the [latest release](https://github.com/Fil/d3-colors-maps/releases/latest) or load directly from [unpkg.com](https://unpkg.com) as a [standalone library](https://unpkg.com/d3-color-maps).

```html
<script src="https://unpkg.com/d3-color@1"></script>
<script src="https://unpkg.com/d3-interpolate@1.3"></script>
<script src="https://unpkg.com/d3-color-maps"></script>
<script>

var color = d3.scaleSequential(d3.interpolateBerlin),
  c = color(0.25); // "#286988"

</script>
```

Or, in combination with the [D3 default bundle](https://github.com/d3/d3):

```html
<script src="https://unpkg.com/d3@5"></script>
<script src="https://unpkg.com/d3-colors-maps@1"></script>
<script>

var color = d3.scaleSequential(d3.interpolateBerlin),
  c = color(0.25); // "#286988"

</script>
```

[Try d3-colors-maps in your browser.](https://tonicdev.com/npm/d3-colors-maps)

## API Reference

### Scientific Color Maps 3.0

These perceptually-uniform color maps by Fabio Crameri are licensed under a [Creative Commons Attribution 4.0 International License](http://creativecommons.org/licenses/by/4.0/).

If you use them in a scientific context, please cite:
> Crameri, F., (2018, May 8). Scientific colour maps (Version 3.0.1). Zenodo. http://doi.org/10.5281/zenodo.1243909

The following interpolators are available. Given a number *t* in the range [0,1], they each return the corresponding color from their color map, represented as an RGB string.


<a href="#interpolateBerlin" name="interpolateBerlin">#</a> d3.<b>interpolateBerlin</b>

<a href="#interpolateBilbao" name="interpolateBilbao">#</a> d3.<b>interpolateBilbao</b>

<a href="#interpolateBroc" name="interpolateBroc">#</a> d3.<b>interpolateBroc</b>

<a href="#interpolateCork" name="interpolateCork">#</a> d3.<b>interpolateCork</b>

<a href="#interpolateDavos" name="interpolateDavos">#</a> d3.<b>interpolateDavos</b>

<a href="#interpolateDevon" name="interpolateDevon">#</a> d3.<b>interpolateDevon</b>

<a href="#interpolateGrayC" name="interpolateGrayC">#</a> d3.<b>interpolateGrayC</b>

<a href="#interpolateLajolla" name="interpolateLajolla">#</a> d3.<b>interpolateLajolla</b>

<a href="#interpolateLapaz" name="interpolateLapaz">#</a> d3.<b>interpolateLapaz</b>

<a href="#interpolateLisbon" name="interpolateLisbon">#</a> d3.<b>interpolateLisbon</b>

<a href="#interpolateOleron" name="interpolateOleron">#</a> d3.<b>interpolateOleron</b>

Oleron is only to be used with topography data and centered.

<a href="#interpolateOslo" name="interpolateOslo">#</a> d3.<b>interpolateOslo</b>

<a href="#interpolateRoma" name="interpolateRoma">#</a> d3.<b>interpolateRoma</b>

<a href="#interpolateTofino" name="interpolateTofino">#</a> d3.<b>interpolateTofino</b>

<a href="#interpolateTokyo" name="interpolateTokyo">#</a> d3.<b>interpolateTokyo</b>

<a href="#interpolateTurku" name="interpolateTurku">#</a> d3.<b>interpolateTurku</b>

<a href="#interpolateVik" name="interpolateVik">#</a> d3.<b>interpolateVik</b>

<img src="https://raw.githubusercontent.com/Fil/d3-colors-maps/master/img/continuous.png" width="100%" height="40" alt="Continuous">

Or, with a discrete number of steps:

<img src="https://raw.githubusercontent.com/Fil/d3-colors-maps/master/img/discrete.png" width="100%" height="40" alt="Continuous">