MCPcopy Index your code
hub / github.com/clips/pattern / _parseRGBA

Function _parseRGBA

pattern/graph/graph.js:228–242  ·  view source on GitHub ↗
(clr)

Source from the content-addressed store, hash-verified

226// or black for edges and transparent for nodes if graph.js is used without canvas.js.
227
228function _parseRGBA(clr) {
229 if (clr && clr.rgba && clr._get) { // canvas.js Color
230 return clr._get();
231 }
232 if (clr instanceof Array) {
233 var r = Math.round(clr[0] * 255);
234 var g = Math.round(clr[1] * 255);
235 var b = Math.round(clr[2] * 255);
236 return "rgba("+r+", "+g+", "+b+", "+clr[3]+")";
237 }
238 if (clr === null) {
239 return "rgba(0,0,0,0)";
240 }
241 return clr;
242}
243
244var _GRAPH_FILL1 = null;
245var _GRAPH_FILL2 = null;

Callers 2

_ctx_graph_fillStyleFunction · 0.85
_ctx_graph_strokeStyleFunction · 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…