-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils_color.c
53 lines (46 loc) · 1.29 KB
/
utils_color.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils_color.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bmerchin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/01/09 15:04:59 by bmerchin #+# #+# */
/* Updated: 2021/01/09 18:31:18 by bmerchin ### ########.fr */
/* */
/* ************************************************************************** */
#include "cub3d.h"
int get_t(int i)
{
i /= 256;
i /= 256;
i /= 256;
return (i % 256);
}
int get_r(int i)
{
i /= 256;
i /= 256;
return (i % 256);
}
int get_g(int i)
{
i /= 256;
return (i % 256);
}
int get_b(int i)
{
return (i % 256);
}
int store_color(int i, int j, int k, int l)
{
int color;
color = i;
color *= 256;
color += j;
color *= 256;
color += k;
color *= 256;
color += l;
return (color);
}