added some structure files

This commit is contained in:
Sam
2022-03-15 20:33:34 +13:00
parent a63bee2540
commit 0be69ea7c3
5 changed files with 582 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
function colourToText(colour) {
return "rgb(" + colour[0] + "," + colour[1] + "," + colour[2] + ")"
}

View File

@@ -0,0 +1,4 @@
function rad(degrees) {
var pi = Math.PI;
return degrees * (pi / 180);
}

10
Catalogue/Scripts/lerp.js Normal file
View File

@@ -0,0 +1,10 @@
function LerpRGB(a, b, t) {
if (t < 0) {
t *= -1;
}
var newColor = [0, 0, 0];
newColor[0] = a[0] + (b[0] - a[0]) * t;
newColor[1] = a[1] + (b[1] - a[1]) * t;
newColor[2] = a[2] + (b[2] - a[2]) * t;
return newColor;
}