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

Function _colorMixin

pattern/canvas.js:903–924  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

901
902// function _colorMixin({fill: Color(), stroke: Color(), strokewidth: 1.0, strokestyle: SOLID})
903function _colorMixin(options) {
904 var s = _ctx.state;
905 var o = options;
906 if (options === undefined) {
907 return [s.fill, s.stroke, s.strokewidth, s.strokestyle, s.linecap];
908 } else {
909 return [
910 (o.fill !== undefined)?
911 (o.fill instanceof Color || o.fill instanceof Gradient)?
912 o.fill : new Color(o.fill) : s.fill,
913 (o.stroke !== undefined)?
914 (o.stroke instanceof Color)?
915 o.stroke : new Color(o.stroke) : s.stroke,
916 (o.strokewidth !== undefined)? o.strokewidth :
917 (o.strokeWidth !== undefined)? o.strokeWidth : s.strokewidth,
918 (o.strokestyle !== undefined)? o.strokestyle :
919 (o.strokeStyle !== undefined)? o.strokeStyle : s.strokestyle,
920 (o.linecap !== undefined)? o.linecap :
921 (o.lineCap !== undefined)? o.lineCap : s.linecap
922 ];
923 }
924}
925
926/*--------------------------------------------------------------------------------------------------*/
927// Wrappers for _ctx.fill() and _ctx.stroke(), only calling them when necessary.

Callers 5

canvas.jsFile · 0.85
lineFunction · 0.85
rectFunction · 0.85
triangleFunction · 0.85
textFunction · 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…