Fixes SetBackgroundColor to return the previous color.

Fixes SetForegroundColor to return the previous color.
Fixes test_Colors to not care about the order of the foreground and background commands.
This commit is contained in:
2023-04-24 14:56:12 -07:00
parent ec4cf99c60
commit 7d6e9ec6b8
2 changed files with 81 additions and 16 deletions

View File

@@ -21,13 +21,13 @@ uint8_t GetForegroundColor() {
}
uint8_t SetBackgroundColor(uint8_t color) {
uint8_t previous_color = color;
uint8_t previous_color = g_background_color;
g_background_color = color;
return previous_color;
}
uint8_t SetForegroundColor(uint8_t color) {
uint8_t previous_color = color;
uint8_t previous_color = g_foreground_color;
g_foreground_color = color;
return previous_color;
}