1
0
Fork 0
mirror of https://github.com/sexybiggetje/pixdisp.git synced 2024-11-22 02:21:02 +01:00

Update code quality

This commit is contained in:
Martijn de Boer 2018-01-05 00:03:37 +01:00
parent b5416d7dc7
commit a597a2c988
2 changed files with 11 additions and 44 deletions

View file

@ -55,10 +55,7 @@ class Driver {
clear( r = 0, g = 0, b = 0, a = 1 ) {
for ( let x = 0; x < this.width; x++ ) {
for ( let y = 0; y < this.height; y++) {
this.matrix[x][y].r = r;
this.matrix[x][y].g = g;
this.matrix[x][y].b = b;
this.matrix[x][y].a = a;
this.setPikel( x, y, r, g, b, a );
}
}
}

View file

@ -42,40 +42,13 @@ class App
createPalette() {
let paletteItBe = [
"0 0 0",
"20 12 28",
"68 36 52",
"48 52 109",
"78 74 78",
"133 76 48",
"52 101 36",
"208 70 72",
"117 113 97",
"89 125 206",
"210 125 44",
"133 149 161",
"109 170 44",
"210 170 153",
"109 194 202",
"218 212 94",
"222 238 214",
"0 71 189",
"2 136 217",
"7 185 252",
"0 149 67",
"0 171 56",
"154 240 0",
"255 179 0",
"255 206 0",
"255 239 59",
"255 206 0",
"255 230 59",
"234 0 52",
"253 71 3",
"255 139 42",
"130 0 172",
"182 16 191",
"204 114 245"
"0 0 0", "20 12 28", "68 36 52", "48 52 109", "78 74 78", "133 76 48",
"52 101 36", "208 70 72", "117 113 97", "89 125 206", "210 125 44",
"133 149 161", "109 170 44", "210 170 153", "109 194 202", "218 212 94",
"222 238 214", "0 71 189", "2 136 217", "7 185 252", "0 149 67",
"0 171 56", "154 240 0", "255 179 0", "255 206 0", "255 239 59",
"255 206 0", "255 230 59", "234 0 52", "253 71 3", "255 139 42",
"130 0 172", "182 16 191", "204 114 245"
];
let holder = document.querySelector( '#paletteHolder' );
@ -151,13 +124,10 @@ class App
let g = imageData.data[ index + 1 ];
let b = imageData.data[ index + 2 ];
if ( r > 0 || g > 0 || b > 0 ) {
if ( r + g + b > 0 ) {
obj.push( {
x: x,
y: y,
r: r,
g: g,
b: b
x: x, y: y,
r: r, g: g, b: b
} )
}
}