3 ms·
I wish the article would have provided the formula for cividis... that is, how to transform a range of values from 0 to 1.0 into standard RGB values.
by lurquer 8y ago
I wish the article would have provided the formula for cividis... that is, how to transform a range of values from 0 to 1.0 into standard RGB values.
- Matumio 8y agoI was looking for a table too, and found https://github.com/pnnl/cmaputil https://github.com/pnnl/cmaputil (colormaps/ directory)
- sbr464 8y agoHere you go https://github.com/sbrichardson/react-cividis/blob/master/src/Cividis/RGB_values_example.js https://github.com/sbrichardson/react-cividis/blob/master/sr...
- tomsmeding 8y agoThe "S2 file" mentioned on the liked page gives a look-up table for the cividis scale: http://journals.plos.org/plosone/article/file?type=supplementary&id=info:doi/10.1371/journal.pone.0199239.s002 http://journals.plos.org/plosone/article/file?type=supplemen... Apart from the comment on line 1, that file contains 256 lines with a colour. I suppose to get a finer scale, you can interpolate with any reasonable function you like since the differences are so small.
- sbr464 8y agoQuick conversion for css etc, multiply each number by 255 to get RGB val, and call Math.round() on each or let the browser round it.