summaryrefslogtreecommitdiffhomepage
path: root/src/rodeo_math.c
blob: f45c6e6400d987d5e510a709c8c6b50d7cb5da62 (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_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);
}