well i build a MAC16 palette in photoshop as your script does (the online tool)
now i can export the image "as is".
Now on my screen, the color does not match.
what is suppose to be a gray #bbb is purple and the gray #444 is green...
no matter i change the palette reference by reorganize (in photoshop) the place of each color as in your coded palette...
oh and i use your palette as the ref palette.
what's wrong?
var img = {
width : 128, height : 128, bpp : 4,
buffer : require("heatshrink").decompress(atob("mUzAJIAJmUykMRiAAEiIHDiMiDZQjIGZwAMkURgI5BABEBgMTFC4AVmJ3EHYgJEU4MSFCqAUn8yOgiAKQIc/DIbFWIxp9BOgL1DAYUARAoJDkY7UPiICBPRQJEAgQCBgMCfUpSBkEAHYr/FAAMhQA0Tf8J8BAIMyfBsRiUSfoQJDgLBBf65+MO4hyCOgYACP4aAFiT/jPxZyBBgR/CBIgACl7/ikD5HPop/DQAYAEQB4ASfpyACP4MiA4KCGf4IBBAAIDDYZJ+Pdoj/LQAILFgCARf6JpCQJgNCP4QHEQIZ6LACcwMgRzEAAgLGkQEDBYkAkaAeNAiADiR8GBIR/FPwkBgSABAIZAXmJ+GAJCKEkMhPgocBAIJ+cn8hPgb/EAggADPwMSkb9GgCACib+cM4hsFPQqEDkMiP4QKCQAQVBiPzQDUyPwroDAAJ6CQA0jkSKFQAcRl7/DAIIAUfwoECA4gzEfYIABP4KADDIaACYBj/OfwJ8HQwZ6DkUikYACmaAECYSACiT9ZmT5GMoR+FPIMyAA0hf4aADCwL/ZfwJ+IBIR8CPAIAHkUSP4iACiMvBwT/JIBcwO4Z+DA4QuBPYJZKQAQZCDQbAMPxk/fwR7GfQR7BMgM/AAaAGP4QADH5r+RPwQBCFgIRE+YBEDgshPogDCkI/Yfw4FBPoJ6EAA7vETo0AiUvH60xLwh+EkR+HAAJcHQAQfFgLZBf6r+IgMTfIqANkciHQL/DDoS9UmcgPwoABgJWDPggAFEA0iEAIhEiS/WG4L+FgB+K/6AKmciEIKADiQNDB4aAOLorgCPx6AFmUykKACAAURkbAVbop+DAAL/OQAR/DkQfEgI/VmJ/FfoqACABaAGmSgFi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CQIr/OAILUELATXCiT6EAAj/BAIKCGAAciDoQAFBAcRgR/KA=="))
};
function draw() {
digitalPulse(LED2, true, 20);
g.clear();
g.drawImage(img,0,0);
g.flip();
}
var g;
function onInit() {
A5.set(); // Backlight On
var colorPalette = new Uint16Array([
0x000000, 0x444444, 0x888888, 0xBBBBBB,
0x996633, 0x663300, 0x006600, 0x00aa00,
0x0099ff, 0x0000cc, 0x330099, 0xff0099,
0xdd0000, 0xff6600, 0xffff00, 0xffffff]);
// 2 couleurs pour la palette
// init spa
var spi = new SPI();
spi.setup({mosi:B15 /* sda */, sck:B13 /* scl */});
g =require("ST7735").connect({
palette:colorPalette,
spi:spi,
dc:A7,
cs:B10,
rst:B1,
// height : 160 // optional, default=128
}, draw
);
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
well i build a MAC16 palette in photoshop as your script does (the online tool)
now i can export the image "as is".
Now on my screen, the color does not match.
what is suppose to be a gray #bbb is purple and the gray #444 is green...
no matter i change the palette reference by reorganize (in photoshop) the place of each color as in your coded palette...
oh and i use your palette as the ref palette.
what's wrong?