Code:
var options = {
squareShema: [8,8],
pixels: new Uint8Array(8 * 8 * 4)
};
options.pixels.fill(122);
var I = 0, localCounter = 0;
// options.pixels.fill(I ,funny, funny+1);
for (var funny = 0; funny < 8*8*4; funny+=4) {
if (funny % 8 == 0) {
localCounter++;
if (I == 0) {I=255} else {I=0}
} else {
if (I == 0) {I=255} else {I=0}
}
options.pixels[funny] = I;
options.pixels[funny + 1] = I;
options.pixels[funny + 2] = I;
options.pixels[funny + 3] = 1;
}
console.log(options.pixels)
What ever i do i get vertical never chess board style.
Any suggestion ?
You need to switch colors every 32 iterations, otherwise you'll get lines instead of a chessboard pattern.