How to convert KML color to HTML/RGB color code (KML to RGB conversion) ?

If you are KML user and you have to use KML defined color in html elements you need to use this.

function hex2rgb(value) {
  var color = "#" + value.substring(6, 8) + value.substring(4, 6) + value.substring(2, 4);
return color;
}

var colour = hex2rgb("99FF11AA");

$(function() {
    $("#output").css("backgroundColor",colour); 
});

Output color code –
kml-to-rgb-color-code

Share

Leave a Reply

Your email address will not be published. Required fields are marked *