-
Notifications
You must be signed in to change notification settings - Fork 0
/
colors.c
63 lines (57 loc) · 1.76 KB
/
colors.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
54
55
56
57
58
59
60
61
62
63
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* colors.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: vvinogra <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/12/30 18:41:44 by vvinogra #+# #+# */
/* Updated: 2017/12/31 15:33:29 by vvinogra ### ########.fr */
/* */
/* ************************************************************************** */
#include "fractol.h"
void color_1(t_frac *frac)
{
frac->rgb->r = frac->i * 15;
frac->rgb->g = frac->i * 10;
frac->rgb->b = frac->i;
}
void color_2(t_frac *frac)
{
frac->rgb->r = frac->i;
frac->rgb->g = frac->i * 10;
frac->rgb->b = frac->i * 15;
}
void color_3(t_frac *frac)
{
frac->rgb->r = frac->i * 17;
frac->rgb->g = frac->i * 9;
frac->rgb->b = frac->i * 19;
}
void color_4(t_frac *frac)
{
frac->rgb->r = frac->i;
frac->rgb->g = frac->i * 14;
frac->rgb->b = frac->i * 4;
}
void color(int keycode, t_frac *frac)
{
if (keycode == 18)
frac->color_nb = 1;
if (keycode == 19)
frac->color_nb = 2;
if (keycode == 20)
frac->color_nb = 3;
if (keycode == 21)
frac->color_nb = 4;
if (keycode == 23)
frac->color_nb = 5;
if (keycode == 22)
frac->color_nb = 6;
if (keycode == 26)
frac->color_nb = 7;
if (keycode == 28)
frac->color_nb = 8;
if (keycode == 25)
frac->color_nb = 9;
}