@micahdb/tscon 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/canvas.js CHANGED
@@ -129,7 +129,7 @@ export class Canvas extends EventTarget {
129
129
  this.mouse_owner = "";
130
130
  this.mouse_down = false;
131
131
  this.mouse_click = false;
132
- this.palette = new Float32Array(PALETTE.map((byte) => byte / 0xff));
132
+ this.palette = new Float32Array(PALETTE.flat().map((byte) => byte / 0xff));
133
133
  this.bitmap_font = loadModernDosTexture(gl);
134
134
  this.user_font = null;
135
135
  this.class_name = "";
package/dist/colour.d.ts CHANGED
@@ -50,7 +50,7 @@ export declare enum Colour {
50
50
  * ```ts
51
51
  * import { Colour, PALETTE } from "@micahdb/tscon";
52
52
  *
53
- * const [r, g, b] = PALETTE.slice(Colour.BLUE * 3, Colour.BLUE * 3 + 3);
53
+ * const [r, g, b] = PALETTE[Colour.BLUE];
54
54
  * ```
55
55
  */
56
- export declare const PALETTE: number[];
56
+ export declare const PALETTE: readonly [number, number, number][];
package/dist/colour.js CHANGED
@@ -52,26 +52,26 @@ export var Colour;
52
52
  * ```ts
53
53
  * import { Colour, PALETTE } from "@micahdb/tscon";
54
54
  *
55
- * const [r, g, b] = PALETTE.slice(Colour.BLUE * 3, Colour.BLUE * 3 + 3);
55
+ * const [r, g, b] = PALETTE[Colour.BLUE];
56
56
  * ```
57
57
  */
58
58
  export const PALETTE = [
59
59
  // dark colours
60
- 0x08, 0x08, 0x08, // Colour.BLACK
61
- 0xed, 0x33, 0x3b, // Colour.RED
62
- 0x57, 0xe3, 0x89, // Colour.GREEN
63
- 0xff, 0x78, 0x00, // Colour.ORANGE
64
- 0x62, 0xa0, 0xea, // Colour.BLUE
65
- 0x91, 0x41, 0xac, // Colour.MAGENTA
66
- 0x5b, 0xc8, 0xaf, // Colour.CYAN
67
- 0xc0, 0xc0, 0xc0, // Colour.GREY
60
+ [0x08, 0x08, 0x08], // Colour.BLACK
61
+ [0xed, 0x33, 0x3b], // Colour.RED
62
+ [0x57, 0xe3, 0x89], // Colour.GREEN
63
+ [0xff, 0x78, 0x00], // Colour.ORANGE
64
+ [0x62, 0xa0, 0xea], // Colour.BLUE
65
+ [0x91, 0x41, 0xac], // Colour.MAGENTA
66
+ [0x5b, 0xc8, 0xaf], // Colour.CYAN
67
+ [0xc0, 0xc0, 0xc0], // Colour.GREY
68
68
  // bright colours
69
- 0x80, 0x80, 0x80, // Colour.BRIGHT_BLACK
70
- 0xf6, 0x61, 0x51, // Colour.BRIGHT_RED
71
- 0x8f, 0xf0, 0xa4, // Colour.BRIGHT_GREEN
72
- 0xff, 0xa3, 0x48, // Colour.YELLOW
73
- 0x99, 0xc1, 0xf1, // Colour.BRIGHT_BLUE
74
- 0xdc, 0x8a, 0xdd, // Colour.BRIGHT_MAGENTA
75
- 0x93, 0xdd, 0xc2, // Colour.BRIGHT_CYAN
76
- 0xf4, 0xf4, 0xf4 // Colour.WHITE
69
+ [0x80, 0x80, 0x80], // Colour.BRIGHT_BLACK
70
+ [0xf6, 0x61, 0x51], // Colour.BRIGHT_RED
71
+ [0x8f, 0xf0, 0xa4], // Colour.BRIGHT_GREEN
72
+ [0xff, 0xa3, 0x48], // Colour.YELLOW
73
+ [0x99, 0xc1, 0xf1], // Colour.BRIGHT_BLUE
74
+ [0xdc, 0x8a, 0xdd], // Colour.BRIGHT_MAGENTA
75
+ [0x93, 0xdd, 0xc2], // Colour.BRIGHT_CYAN
76
+ [0xf4, 0xf4, 0xf4], // Colour.WHITE
77
77
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micahdb/tscon",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "WebGL 2.0 text-mode graphics in TypeScript.",
5
5
  "license": "MIT",
6
6
  "author": "Micah Baker",