lib/ui/charting/js_charting.js
function(rgbaStr) {
            // lazy create the regex
            if(!this.rgbaRegex) {
                this.rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,[\s\d.]+\)\s*$/;
            }
            var colorComponents = this.rgbaRegex.exec(rgbaStr);
            if(!colorComponents) {
                return rgbaStr;
            }
            return ("rgb(" + colorComponents[1] + ", " + colorComponents[2] + ", " + colorComponents[3] + ")");
        }
function(rgbaStr) {
            // lazy create the regex
            if(!this.rgbaRegex) {
                this.rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,[\s\d.]+\)\s*$/;
            }
            var colorComponents = this.rgbaRegex.exec(rgbaStr);
            if(!colorComponents) {
                return rgbaStr;
            }
            return ("rgb(" + colorComponents[1] + ", " + colorComponents[2] + ", " + colorComponents[3] + ")");
        }
function ( rgbaStr ) { // lazy create the regex if ( ! this . rgbaRegex ) { this . rgbaRegex = / ^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,[\s\d.]+\)\s*$ / ; } var colorComponents = this . rgbaRegex . exec ( rgbaStr ) ; if ( ! colorComponents ) { return rgbaStr ; } return ( "rgb(" + colorComponents [ 1 ] + ", " + colorComponents [ 2 ] + ", " + colorComponents [ 3 ] + ")" ) ; }
given a color string in rgba format, returns the equivalent color in rgb format if the color string is not in valid rgba format, returns the color string un-modified
given a color string in rgba format returns the equivalent color in rgb format if the color string is not in valid rgba format returns the color string un - modified