This commit is contained in:
schmelczerandras 2020-11-04 16:01:17 +01:00
parent 1ce961d6c2
commit 99cdb62928
76 changed files with 340 additions and 433 deletions

View file

@ -1,5 +1,5 @@
import { vec2 } from 'gl-matrix';
import { serializable } from '../transport/serialization/serializable';
import { serializable } from '../serialization/serializable';
@serializable
export class Circle {

View file

@ -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;

View file

@ -1,5 +0,0 @@
let currentId = 0;
export const id = (): number => {
return currentId++;
};

View file

@ -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');

View file

@ -1,4 +1,4 @@
// src
// source
// https://stackoverflow.com/questions/521295/seeding-the-random-number-generator-in-javascript
// Mulberry32

View file

@ -1,5 +1,5 @@
import { vec2 } from 'gl-matrix';
import { serializable } from '../transport/serialization/serializable';
import { serializable } from '../serialization/serializable';
@serializable
export class Rectangle {

View file

@ -1 +0,0 @@
export const toPercent = (value: number) => `${Math.round(value * 100)}%`;