dirty initial commit

This commit is contained in:
Zutatensuppe 2020-11-07 11:35:29 +01:00
commit 2351c93677
24 changed files with 2203 additions and 0 deletions

22
game/Color.js Normal file
View file

@ -0,0 +1,22 @@
export function tint(c, f) {
return [
Math.max(0, Math.min(255, Math.round((255 - c[0]) * f))),
Math.max(0, Math.min(255, Math.round((255 - c[1]) * f))),
Math.max(0, Math.min(255, Math.round((255 - c[2]) * f))),
c[3]
]
}
export function shade(c, f) {
return [
Math.max(0, Math.min(255, Math.round(c[0] * f))),
Math.max(0, Math.min(255, Math.round(c[1] * f))),
Math.max(0, Math.min(255, Math.round(c[2] * f))),
c[3]
]
}
export default {
tint,
shade
}