blob: b85981514a5dc703befdf6e17e16947181072acd (
plain)
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
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_hex_to_rgb.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: joelecle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 17:28:58 by joelecle #+# #+# */
/* Updated: 2020/02/14 17:28:58 by joelecle ### ########lyon.fr */
/* */
/* ************************************************************************** */
#include <cub3d.h>
#include <stdint.h>
t_rgb
ft_hex_to_og_rgb(uint32_t color)
{
t_rgb rgb;
rgb.r = (color >> 16) & 255;
rgb.g = (color >> 8) & 255;
rgb.b = color & 255;
return (rgb);
}
t_bmp_rgb
ft_hex_to_rgb(uint32_t color)
{
t_bmp_rgb rgb;
rgb.r = (color >> 16) & 255;
rgb.g = (color >> 8) & 255;
rgb.b = color & 255;
return (rgb);
}
|