aboutsummaryrefslogtreecommitdiff
path: root/src/Framebuffer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/Framebuffer.ts')
-rw-r--r--src/Framebuffer.ts10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Framebuffer.ts b/src/Framebuffer.ts
index b9926d2..a6ad5fc 100644
--- a/src/Framebuffer.ts
+++ b/src/Framebuffer.ts
@@ -1,5 +1,3 @@
-import {Colour} from './Colour';
-
export class Framebuffer {
readonly width: number;
readonly height: number;
@@ -24,11 +22,11 @@ export class Framebuffer {
);
}
- writePixelAt(x: number, y: number, colour: Colour) {
+ writePixelAt(x: number, y: number, r: number, g: number, b: number) {
const startIdx = (y * this.width + x) * 4;
- this.canvasImageData.data[startIdx] = colour.r;
- this.canvasImageData.data[startIdx + 1] = colour.g;
- this.canvasImageData.data[startIdx + 2] = colour.b;
+ this.canvasImageData.data[startIdx] = r;
+ this.canvasImageData.data[startIdx + 1] = g;
+ this.canvasImageData.data[startIdx + 2] = b;
this.canvasImageData.data[startIdx + 3] = 255; // No A
}