summaryrefslogtreecommitdiffhomepage
path: root/src/rodeo_math.c
blob: 248e6007ea5b9db5ce3967067824df07e247d093 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// public internal
#include "rodeo.h"
#include "rodeo_math.h"

uint32_t
Rodeo__\
Math__\
color_rgba_to_uint32(const Rodeo__color_rgba_t color)
{
	return
	  ((uint32_t)(uint8_t)(color.red   * 255))
	| ((uint32_t)(uint8_t)(color.green * 255)) << (8 * 1)
	| ((uint32_t)(uint8_t)(color.blue  * 255)) << (8 * 2)
	| ((uint32_t)(uint8_t)(color.alpha * 255)) << (8 * 3);
}