Comments (4)
One can retrieve the color schemes directly from https://github.com/mikeperrins/cmocean-LUT-ImageJ:
const lut = name => d3.tsv(
`https://raw.githubusercontent.com/mikeperrins/cmocean-LUT-ImageJ/master/${name}.lut`,
d => d3.rgb(d["Red"], d["Green"], d["Blue"])
)
.then(l => t => l[(t * 256) | 0]);
const l = await lut("Ice");
l(0.5).toString(); // "rgb(66, 122, 183)"
(see https://observablehq.com/@fil/cmocean )
the next step would be to extract key colors for the spline interpolation:
https://bl.ocks.org/mbostock/048d21cf747371b11884f75ad896e5a5
from d3-scale-chromatic.
The monotone RGB interpolation on 11 evenly-spaced control points is almost perfect for: Algae, Amp, Delta, Dense, Gray, Ice, Matter, Solar, Speed, Tempo, Thermal, Turbid.
For Haline, Phase we might need a few more control points or adjustments.
For Balance, Curl, Deep, Oxy, however, the interpolation strategy can't reproduce the brutal transitions, and it will need a bit more work (cutting each of them in two or three parts interpolated separately then rejoined), or we could have them as a 256-color array, depending on which approach gives the smallest file size(?).
from d3-scale-chromatic.
See also https://observablehq.com/@fil/cmasher for the CMasher collection (https://cmasher.readthedocs.io/)
from d3-scale-chromatic.
And colorcet: https://observablehq.com/@fil/colorcet
Collection of color schemes: https://observablehq.com/collection/@fil/color-schemes
from d3-scale-chromatic.
Related Issues (20)
- Missing Color Schemes HOT 2
- Is this included by default in d3v5? If so, should the README reflect that?
- does it support es6 import? HOT 4
- Add cividis color scale, a scheme for viewers with color vision deficiency HOT 4
- Heterogeneous format of color with different color schemes HOT 2
- Add discrete color schemes for arbitrary counts HOT 1
- categorical scheme with gradients HOT 3
- interpolateCividis yields grayscale HOT 1
- Support various output formats HOT 3
- Change the default scheme interpolator? HOT 19
- README link to Cubehelix scheme doesn't load
- Calculate color with two variables (t1, t2)? HOT 15
- Adding HSV colormap HOT 3
- Pastel diverging color scheme HOT 1
- Hex code to d3 color palette conversion HOT 2
- Add option for opacity/alpha HOT 2
- Add support for rocket, mako, flare, and crest HOT 2
- Build error in 1.5.4 HOT 2
- Ordinal scales are broken HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-scale-chromatic.