Application Framework Reference

Splunk API

normalizeColor()

The normalizeColor() method converts an RGB or hexadecimal color value to a fully-qualified hexadecimal equivalent.

Synopsis

hexColor = Splunk.util.normalizeColor( color )

Parameters

color

String

RGB or hexadecimal color value.

Return Value

String

Fully-qualified, six-digit hexadecimal color value with leading number symbol (#), or null, if color cannot be processed.

Example

getCSSColor: function(specificity, cssProperty){
    var color;
    for (var i=0; i<specificity.length; i++){
        var computedColor = specificity[i].css(cssProperty);
        color = Splunk.util.normalizeColor(computedColor);
        if (color){
            return color;
        }  
    }  
    return null;
},
  
  
 

See Also

getHex()