WoW Guild API / Emblem color

API Discussion
Hello,

It seems the colors returned by the guild profile API are not matching armory or in game color.

I went into the javascript code of the armory guild page and there is a color map, and the color is retrieved by its index. Unfortunatly the api does not give us the color index.

The background of my guild is pink in my application instead of red.
http://eu.battle.net/wow/fr/guild/conseil-des-ombres/Ave_Tenebrae/
vs
http://snag.gy/0ew7w.jpg

You can see the color index here (second number in the lists) :
$(document).ready(function() {
var tabard = new GuildTabard('guild-tabard', {
'ring': 'horde',
'bg': [ 0, 5 ],
'border': [ 3, 14 ],
'emblem': [ 62, 15 ]
});
});


Also, I took the "recolor" function from the armory javascript as an example, so the rules for recoloring should be the same.

function changeColor(img, color) {
if(!originalPixels) return; // Check if image has loaded
var newColor = hexToRGB(color);
var intensityScale = 19.0;
var blend = 1.0 / 3.0;
var added_r = newColor.R / intensityScale + newColor.R * blend;
var added_g = newColor.G / intensityScale + newColor.G * blend;
var added_b = newColor.B / intensityScale + newColor.B * blend;
var scale_r = newColor.R / 255.0 + blend;
var scale_g = newColor.G / 255.0 + blend;
var scale_b = newColor.B / 255.0 + blend;

for(var I = 0, L = originalPixels.data.length; I < L; I += 4) {
if(currentPixels.data[I + 3] > 0) {
currentPixels.data[I] = originalPixels.data[I] * scale_r + added_r;
currentPixels.data[I + 1] = originalPixels.data[I + 1] * scale_g + added_g;
currentPixels.data[I + 2] = originalPixels.data[I + 2] * scale_b + added_b;
}
}

ctx.putImageData(currentPixels, 0, 0);
img.src = canvas.toDataURL("image/png");
}


Is this a bug, or am I missing something ?
we have been trying to figure this out for a while its a known issue we have asked for clarity but the devs have said they would look into it
For reference: http://us.battle.net/en/forum/topic/14525182697

To summarize that thread, when attempting to find the nearest matching armory color, neither standard geometric formulas nor complex perception formulas work.

As to whether it is a bug, I'd say no. If I remember correctly, the API color matches the in-game color, and it is the armory site that has the problem.
Thanks for the answers.
I guess if I find the courage I will hard-code a map matching api color to colormap values from the armory. If I manage to do it, I will share it.
Well at least It works.
Got the index by going to random guilds page on the armory, then getting hex code with the API.

http://snag.gy/RFRAy.jpg


var _colorMap = [
// Background
{"b1002e":[5,[133,11,0]], "860f9a":[35,[108,8,128]], "fc6891":[50,[229,107,140]], "232323":[45,[15,26,31]], "ffffff":[49,[211,211,198]],
"04b78f":[25,[4,152,122]]},

// Border
{"ffffff":[14,[153,159,149]], "54370a":[13,[103,51,53]], "670021":[0,[97,42,44]], "f9cc30":[16,[155,94,28]], "0f1415":[15, [38,46,38]],
"00317c":[10,[55,60,100]]},

// Emblem
{"101517":[15,[16,20,22]], "675600":[3,[103,86,0]], "b1b8b1":[14,[177,183,176]], "00671f":[7,[0,102,30]], "636700":[4,[98,102,0]],
"092a5d":[10,[9,42,94]]}
];


The backgrounds are gonna be really annoying though, only 6/51 :(
Hey all,

While I do not have a intricate knowledge of the guild emblem script linked above, I was able to compile the below data.

I believe the colorId value might be the elusive color index you are looking for.

{"guildColors":{"backgrounds":{"0":{"colorId":0,"hexRGB":"ff2088"},"1":{"colorId":1,"hexRGB":"bd005b"},"2":{"colorId":2,"hexRGB":"9e0036"},"3":{"colorId":3,"hexRGB":"ff891b"},"4":{"colorId":4,"hexRGB":"e14500"},"5":{"colorId":5,"hexRGB":"b1002e"},"6":{"colorId":6,"hexRGB":"ffb317"},"7":{"colorId":7,"hexRGB":"f68700"},"8":{"colorId":8,"hexRGB":"ae4b00"},"9":{"colorId":9,"hexRGB":"fffc14"},"10":{"colorId":10,"hexRGB":"f3ca00"},"11":{"colorId":11,"hexRGB":"c49b00"},"12":{"colorId":12,"hexRGB":"ffff14"},"13":{"colorId":13,"hexRGB":"d8dd00"},"14":{"colorId":14,"hexRGB":"a6ac00"},"15":{"colorId":15,"hexRGB":"e3f618"},"17":{"colorId":17,"hexRGB":"8e9700"},"16":{"colorId":16,"hexRGB":"b7c003"},"19":{"colorId":19,"hexRGB":"88ba03"},"18":{"colorId":18,"hexRGB":"bcf61b"},"21":{"colorId":21,"hexRGB":"1eff68"},"20":{"colorId":20,"hexRGB":"588000"},"23":{"colorId":23,"hexRGB":"00820f"},"22":{"colorId":22,"hexRGB":"04c347"},"25":{"colorId":25,"hexRGB":"04b78f"},"24":{"colorId":24,"hexRGB":"1ef7c1"},"27":{"colorId":27,"hexRGB":"21dcff"},"26":{"colorId":26,"hexRGB":"009061"},"29":{"colorId":29,"hexRGB":"006391"},"28":{"colorId":28,"hexRGB":"009dc5"},"31":{"colorId":31,"hexRGB":"2c6aae"},"30":{"colorId":30,"hexRGB":"4d8eda"},"34":{"colorId":34,"hexRGB":"ad29ac"},"35":{"colorId":35,"hexRGB":"860f9a"},"32":{"colorId":32,"hexRGB":"003582"},"33":{"colorId":33,"hexRGB":"d34ac8"},"38":{"colorId":38,"hexRGB":"9b00a6"},"39":{"colorId":39,"hexRGB":"ff1fbf"},"36":{"colorId":36,"hexRGB":"ff38fa"},"37":{"colorId":37,"hexRGB":"c900c3"},"42":{"colorId":42,"hexRGB":"c58132"},"43":{"colorId":43,"hexRGB":"875513"},"40":{"colorId":40,"hexRGB":"d30087"},"41":{"colorId":41,"hexRGB":"a30068"},"46":{"colorId":46,"hexRGB":"646464"},"47":{"colorId":47,"hexRGB":"b4bba8"},"44":{"colorId":44,"hexRGB":"4f2300"},"45":{"colorId":45,"hexRGB":"232323"},"50":{"colorId":50,"hexRGB":"fc6891"},"49":{"colorId":49,"hexRGB":"ffffff"},"48":{"colorId":48,"hexRGB":"d7ddcb"}},"icons":{"0":{"colorId":0,"hexRGB":"670021"},"1":{"colorId":1,"hexRGB":"672300"},"2":{"colorId":2,"hexRGB":"674500"},"3":{"colorId":3,"hexRGB":"675600"},"4":{"colorId":4,"hexRGB":"636700"},"5":{"colorId":5,"hexRGB":"516700"},"6":{"colorId":6,"hexRGB":"376700"},"7":{"colorId":7,"hexRGB":"00671f"},"8":{"colorId":8,"hexRGB":"006757"},"9":{"colorId":9,"hexRGB":"004867"},"10":{"colorId":10,"hexRGB":"092a5d"},"11":{"colorId":11,"hexRGB":"56095d"},"12":{"colorId":12,"hexRGB":"5d094f"},"13":{"colorId":13,"hexRGB":"54370a"},"14":{"colorId":14,"hexRGB":"b1b8b1"},"15":{"colorId":15,"hexRGB":"101517"},"16":{"colorId":16,"hexRGB":"dfa55a"}},"borders":{"0":{"colorId":0,"hexRGB":"670021"},"1":{"colorId":1,"hexRGB":"672300"},"2":{"colorId":2,"hexRGB":"674500"},"3":{"colorId":3,"hexRGB":"675600"},"4":{"colorId":4,"hexRGB":"639400"},"5":{"colorId":5,"hexRGB":"63a300"},"6":{"colorId":6,"hexRGB":"63b300"},"7":{"colorId":7,"hexRGB":"00671f"},"8":{"colorId":8,"hexRGB":"008e90"},"9":{"colorId":9,"hexRGB":"006793"},"10":{"colorId":10,"hexRGB":"00317c"},"11":{"colorId":11,"hexRGB":"6d0077"},"12":{"colorId":12,"hexRGB":"7b0067"},"13":{"colorId":13,"hexRGB":"54370a"},"14":{"colorId":14,"hexRGB":"ffffff"},"15":{"colorId":15,"hexRGB":"0f1415"},"16":{"colorId":16,"hexRGB":"f9cc30"}}}}

I hope you find the above data useful :).
Omg thanks ! You just saved me days of boring work. No more hoping to find new colors on guild pages :D
Interesting...

Formatted it and threw it into a gist for everyone:
https://gist.github.com/anonymous/50441e4a8132ee4c2444
I finished mapping the colors. It's javascript but I guess It's not too hard to translate to another language.
It's a direct mapping of api color to armory colors.

https://gist.github.com/Ika62/c55a61c265701fa8c29a

Join the Conversation

Return to Forum