summaryrefslogtreecommitdiff
path: root/test/painter/color.c
blob: b1b15016b15b784ee55ca5a820836f4b93f0b1bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "painter/color.h"
#include <assert.h>

/**
 * File: color.c
 *
 * Author:
 *   Pacien TRAN-GIRARD
 */

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;
}