From 190449ee18bec69b2e385dccd9bd42ddc83dd418 Mon Sep 17 00:00:00 2001 From: pacien Date: Thu, 28 Dec 2017 01:22:41 +0100 Subject: Refactor and test color Signed-off-by: pacien --- test/painter/color.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/painter/color.c (limited to 'test') diff --git a/test/painter/color.c b/test/painter/color.c new file mode 100644 index 0000000..bdfe9b3 --- /dev/null +++ b/test/painter/color.c @@ -0,0 +1,14 @@ +#include "painter/color.h" +#include + +static void test_color_blend() { + Color a = {{1, 10, 100, 200}}, b = {{100, 1, 200, 10}}; + assert(color_equals(color_blend(a, b, TIME_ORIGIN), a)); + assert(color_equals(color_blend(a, b, TIME_UNIT), b)); + assert(color_equals(color_blend(a, b, 0.25), (Color) {{50, 9, 132, 173}})); +} + +int main(int argc, char **argv) { + test_color_blend(); + return 0; +} -- cgit v1.2.3