Refactor
This commit is contained in:
parent
1ce961d6c2
commit
99cdb62928
76 changed files with 340 additions and 433 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { serializable } from '../transport/serialization/serializable';
|
||||
import { serializable } from '../serialization/serializable';
|
||||
|
||||
@serializable
|
||||
export class Circle {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { vec3 } from 'gl-matrix';
|
||||
import { rgb } from './rgb';
|
||||
|
||||
// source: https://stackoverflow.com/questions/2353211/hsl-to-rgb-color-conversion
|
||||
export const hsl = (hue: number, saturation: number, lightness: number): vec3 => {
|
||||
hue /= 360;
|
||||
saturation /= 100;
|
||||
|
|
|
|||
|
|
@ -1,5 +0,0 @@
|
|||
let currentId = 0;
|
||||
|
||||
export const id = (): number => {
|
||||
return currentId++;
|
||||
};
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
export const prettyPrint = (o: any): string =>
|
||||
JSON.stringify(o, (_, v) => (v.toFixed ? Number(v.toFixed(3)) : v), ' ')
|
||||
.replace(/("|,|{|^\n)/g, '')
|
||||
.replace(/(\W*}\n?)+/g, '\n\n');
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
// src
|
||||
// source
|
||||
// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript
|
||||
// Mulberry32
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { vec2 } from 'gl-matrix';
|
||||
import { serializable } from '../transport/serialization/serializable';
|
||||
import { serializable } from '../serialization/serializable';
|
||||
|
||||
@serializable
|
||||
export class Rectangle {
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
export const toPercent = (value: number) => `${Math.round(value * 100)}%`;
|
||||
Loading…
Add table
Add a link
Reference in a new issue