code: function (item, visible) {
              var legend = this,
                options = legend.options,
                legendItem = item.legendItem,
                legendLine = item.legendLine,
                legendSymbol = item.legendSymbol,
                hiddenColor = legend.itemHiddenStyle.color,
                textColor = visible ? options.itemStyle.color : hiddenColor,
                symbolColor = visible ? (item.legendColor || item.color || '#CCC') : hiddenColor,
                markerOptions = item.options && item.options.marker,
                symbolAttr = { fill: symbolColor },
                key,
                val;
  
              if (legendItem) {
                  legendItem.css({ fill: textColor, color: textColor }); // color for #1553, oldIE
              }
              if (legendLine) {
                  legendLine.attr({ stroke: symbolColor });
              }
  
              if (legendSymbol) {
  
                  // Apply marker options
                  if (markerOptions && legendSymbol.isMarker) { // #585
                      symbolAttr.stroke = symbolColor;
                      markerOptions = item.convertAttribs(markerOptions);
                      for (key in markerOptions) {
                          val = markerOptions[key];
                          if (val !== UNDEFINED) {
                              symbolAttr[key] = val;
                          }
                      }
                  }
  
                  legendSymbol.attr(symbolAttr);
              }
          }
docs: Set the colors for the legend item
  @param {Object} item A Series or Point instance
  @param {Object} visible Dimmed or colored