diff options
Diffstat (limited to 'test/blender/blender.c')
-rw-r--r-- | test/blender/blender.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/blender/blender.c b/test/blender/blender.c new file mode 100644 index 0000000..7c33198 --- /dev/null +++ b/test/blender/blender.c | |||
@@ -0,0 +1,18 @@ | |||
1 | #include "blender/blender.h" | ||
2 | #include <assert.h> | ||
3 | |||
4 | static void test_color_blending() { | ||
5 | Color a = {{0xFF, 0xED, 0x00, 0x00}}; | ||
6 | Color b = {{0x00, 0x47, 0xAB, 0x00}}; | ||
7 | Color result = blender_blend_colors(a, b, 0.125); | ||
8 | |||
9 | assert(result.rgba.r == 0xEE && | ||
10 | result.rgba.g == 0xDF && | ||
11 | result.rgba.b == 0x3C && | ||
12 | result.rgba.a == 0x00); | ||
13 | } | ||
14 | |||
15 | int main(int argc, char **argv) { | ||
16 | test_color_blending(); | ||
17 | return 0; | ||
18 | } | ||