mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 10:11:09 +00:00
* Adds a unit test for client colours. (#77484) ## About The Pull Request I'm adding a unit test for the sanity of client colours, ancient datums which I had refactored a long time ago. This also affects the `color_to_full_rgba_matrix()` proc, which I had also worked on. ## Why It's Good For The Game Ever since that aforementioned years old refactor, there have always been a few issues with client colours. The most annoying one being the monochromacy client color lingering even after the blindness status effect is ok. It's unlikely this will fix that. However, this should clear a few other runtimes with the feature. ## Changelog N/A. * Adds a unit test for client colours. --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
10 lines
476 B
Plaintext
10 lines
476 B
Plaintext
///Checks that client colours have valid colour variables values at least when inited.
|
|
/datum/unit_test/client_colours
|
|
|
|
/datum/unit_test/client_colours/Run()
|
|
for(var/datum/client_colour/colour as anything in subtypesof(/datum/client_colour))
|
|
// colours can be color matrices (lists), which initial() cannot read.
|
|
colour = new colour
|
|
if(!color_to_full_rgba_matrix(colour.colour, FALSE))
|
|
TEST_FAIL("[colour.type] has an invalid default colour value: [colour.colour]")
|