Refactored colorMap for use in tristate and bar charts. Includes support for function(sparkline,options,index,value)