tasks/lib/colorize-svg.js
function svgcolor(el, color) {
      var styles = window.getComputedStyle(el, null);

      var fill = styles['fill'];
      var stroke = styles['stroke'];

      var isFill, isStroke;
      if (!fill && !stroke) {
        isFill = true;
      }
      else {
        if (fill && fill !== 'none') {
          isFill = true;
        }

        if (stroke && stroke !== 'none') {
          isStroke = true;
        }
      }

      if (isStroke) {
        el.style.stroke = null;
        el.setAttribute('stroke', color || stroke);
      }

      if (isFill) {
        el.style.fill = null;
        el.setAttribute('fill', color || fill);
      }
    }
function svgcolor(el, color) {
      var styles = window.getComputedStyle(el, null);

      var fill = styles['fill'];
      var stroke = styles['stroke'];

      var isFill, isStroke;
      if (!fill && !stroke) {
        isFill = true;
      }
      else {
        if (fill && fill !== 'none') {
          isFill = true;
        }

        if (stroke && stroke !== 'none') {
          isStroke = true;
        }
      }

      if (isStroke) {
        el.style.stroke = null;
        el.setAttribute('stroke', color || stroke);
      }

      if (isFill) {
        el.style.fill = null;
        el.setAttribute('fill', color || fill);
      }
    }
function svgcolor ( el , color ) { var styles = window . getComputedStyle ( el , null ) ; var fill = styles [ 'fill' ] ; var stroke = styles [ 'stroke' ] ; var isFill , isStroke ; if ( ! fill && ! stroke ) { isFill = true ; } else { if ( fill && fill !== 'none' ) { isFill = true ; } if ( stroke && stroke !== 'none' ) { isStroke = true ; } } if ( isStroke ) { el . style . stroke = null ; el . setAttribute ( 'stroke' , color || stroke ) ; } if ( isFill ) { el . style . fill = null ; el . setAttribute ( 'fill' , color || fill ) ; } }
Given an element, color it by inlining a fill or stroke attribute. If color isn't define, it will use the current computed style for use when applying styles via CSS
Given an element color it by inlining a fill or stroke attribute . If color isn t define it will use the current computed style for use when applying styles via CSS