MCPcopy Index your code
hub / github.com/plotly/plotly.js / parseColorScale

Function parseColorScale

src/lib/gl_format_color.js:73–88  ·  view source on GitHub ↗
(cont)

Source from the content-addressed store, hash-verified

71}
72
73function parseColorScale(cont) {
74 var cOpts = Colorscale.extractOpts(cont);
75
76 var colorscale = cOpts.colorscale;
77 if(cOpts.reversescale) colorscale = Colorscale.flipScale(cOpts.colorscale);
78
79 return colorscale.map(function(elem) {
80 var index = elem[0];
81 var color = tinycolor(elem[1]);
82 var rgb = color.toRgb();
83 return {
84 index: index,
85 rgb: [rgb.r, rgb.g, rgb.b, rgb.a]
86 };
87 });
88}
89
90module.exports = {
91 formatColor: formatColor,

Callers 6

convert.jsFile · 0.85
convert.jsFile · 0.85
convertFunction · 0.85
convert.jsFile · 0.85
convertFunction · 0.85
convert.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…