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

Function generateExtendedColors

src/traces/pie/calc.js:149–167  ·  view source on GitHub ↗

* pick a default color from the main default set, augmented by * itself lighter then darker before repeating

(colorList, extendedColorWays)

Source from the content-addressed store, hash-verified

147 * itself lighter then darker before repeating
148 */
149function generateExtendedColors(colorList, extendedColorWays) {
150 var i;
151 var colorString = JSON.stringify(colorList);
152 var colors = extendedColorWays[colorString];
153 if(!colors) {
154 colors = colorList.slice();
155
156 for(i = 0; i < colorList.length; i++) {
157 colors.push(tinycolor(colorList[i]).lighten(20).toHexString());
158 }
159
160 for(i = 0; i < colorList.length; i++) {
161 colors.push(tinycolor(colorList[i]).darken(20).toHexString());
162 }
163 extendedColorWays[colorString] = colors;
164 }
165
166 return colors;
167}
168
169module.exports = {
170 calc: calc,

Callers 2

calc.jsFile · 0.85
crossTraceCalcFunction · 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…