excaliburjs / Excalibur

🎮 Your friendly TypeScript 2D game engine for the web 🗡️
https://excaliburjs.com
BSD 2-Clause "Simplified" License
1.77k stars 189 forks source link

Graphic.tint nullability #3119

Closed raylu closed 2 months ago

raylu commented 2 months ago

Graphic.tint is a non-nullable Color, but it starts as null and the way to remove tint from a graphic is to set it back to null

eonarheim commented 2 months ago

Good find! Definitely a bug

eonarheim commented 2 months ago

We have loose types on parts of the project that allow these bugs to sneak through, adjusting this type should fix things. https://github.com/excaliburjs/Excalibur/blob/main/src/engine/Graphics/Graphic.ts#L60

Additionally we should drop a new tsconfig targeting this directory to incrementally shore up types.