Add support for randomising colours

This commit is contained in:
2024-07-31 22:11:11 +01:00
parent 39b40cdf5f
commit 5f44936dcd
3 changed files with 22 additions and 4 deletions

View File

@@ -5,6 +5,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
enum {
TINY_EXIT_SUCCESS,
@@ -20,6 +21,8 @@ int main(void) {
return TINY_EXIT_ARENA_INIT_FAILED;
}
srand(time(NULL));
Colour bg = {.r = 42, .g = 45, .b = 52, .a = 255};
Colour teal = {.r = 14, .g = 156, .b = 208, .a = 255};
Colour orange = {.r = 242, .g = 100, .b = 48, .a = 255};
@@ -34,8 +37,8 @@ int main(void) {
}
clear_image(&img, bg);
render_model(&model, &img, teal, RENDER_TYPE_FILLED);
render_model(&model, &img, orange, RENDER_TYPE_WIREFRAME);
render_model(&model, &img, teal, RENDER_TYPE_FILLED, COLOUR_TYPE_RANDOM);
render_model(&model, &img, orange, RENDER_TYPE_WIREFRAME, COLOUR_TYPE_FIXED);
save_image(&img, "result.pam");
wapp_mem_arena_destroy(&arena);