-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcolor.c
More file actions
43 lines (37 loc) · 1.37 KB
/
Copy pathcolor.c
File metadata and controls
43 lines (37 loc) · 1.37 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* color.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mhasan <mhasan@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/05 17:28:54 by mhasan #+# #+# */
/* Updated: 2020/02/14 13:53:02 by mhasan ### ########.fr */
/* */
/* ************************************************************************** */
#include "fdf.h"
void fruit_color(t_fdf *data, int x, int y)
{
int z;
z = data->map[y][x];
if (z * data->altitude < 0)
data->color = 0x009292;
else
data->color = 0xF65156;
}
void trendy_color(t_fdf *data, int x, int y)
{
int z;
z = data->map[y][x];
if (z * data->altitude < 0)
data->color = 0xCC1A99;
else
data->color = 0x6FFF5E;
}
void color(t_fdf *data, int x, int y)
{
if (data->palette == FRUIT)
fruit_color(data, x, y);
else if (data->palette == TRENDY)
trendy_color(data, x, y);
}