I omitted this earlier to avoid confusion. Written communication doesn't come easily to us all #actuallyautistic.
This is part of a larger script in Photoshop taken from here
I'm trying to extract the palette values in the image as hexadecimal colours or RGB values.
var msg = "";
for (var i = 0; i < 256; i++)
{
var bin = String.fromCharCode(table.charCodeAt(i), table.charCodeAt(256+i), table.charCodeAt(512+i))
msg += bin.toString(2);
// msg += (table.charCodeAt(i), table.charCodeAt(256+i), table.charCodeAt(512+i));
// msg += "\n";
}
The version commented out collects the Blue data, but not the Red or Green. I don't know why.
msg
is then written to a file. In Notepad it looks like this:
@@ `@ €` @ @¿©Ð´€€aà€@€ DDD
Which seems meaningless. In Sublime Text I can see it's a series of hex numbers.
0000 0020 4040 0060 4020 8060 0040 2040
bf7f a9d0 b480 8061 e080 4080 2000 4444
4420 2020 0000...
In pure Javascript (or ECMA rather), how can I convert the former to the latter?