Convert the ascii color code to hex
Hello
I've been confused for a few days and I can't make a logical code equation to read the existing color code.
I want to know how to convert this output to Hex color code
[Project]
We want to be able to call the names and colors code in the following address with script code
AE => Edit => Preferences => Labels => Label Colors


[My Code]
var Color = app.preferences.getPrefAsString("Label Preference Color Section 5", "Label Color ID 2 # 1", PREFType.PREF_Type_MACHINE_INDEPENDENT);
var NameColor = app.preferences.getPrefAsString("Label Preference Text Section 7", "Label Text ID 2 # 1", PREFType.PREF_Type_MACHINE_INDEPENDENT);
[Problem]
Color = ��
NameColor = Red

[Want !]
How Can Read Color Code whit Hex
[efforts]
var aaColor = app.preferences.getPrefAsString("Label Preference Color Section 5", "Label Color ID 2 # 1", PREFType.PREF_Type_MACHINE_INDEPENDENT);
var aaNameColor = app.preferences.getPrefAsString("Label Preference Text Section 7", "Label Text ID 2 # 1", PREFType.PREF_Type_MACHINE_INDEPENDENT);
String.prototype.hexEncode = function(){
var hex, i;
var result = "";
for (i=0; i<this.length; i++) {
hex = this.charCodeAt(i).toString(16);
result += ("000"+hex).slice(-4);
}
return result
}
var aaHex = aaColor.hexEncode();
I definitely believe it's possible!
Please tell if someone knows the solution!
Tnx Alot
