diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-04 23:55:12 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-04 23:55:12 +0100 |
commit | 998d2df1356f83049c30f71bd5dc4c0597fd4824 (patch) | |
tree | 660eef6063088eea2b844984c49c5aa1b2b6e2f2 /src/ft_hex_to_rgb.c | |
parent | Clean (diff) | |
download | 42-cub3d-998d2df1356f83049c30f71bd5dc4c0597fd4824.tar.gz 42-cub3d-998d2df1356f83049c30f71bd5dc4c0597fd4824.tar.bz2 42-cub3d-998d2df1356f83049c30f71bd5dc4c0597fd4824.tar.xz 42-cub3d-998d2df1356f83049c30f71bd5dc4c0597fd4824.tar.zst 42-cub3d-998d2df1356f83049c30f71bd5dc4c0597fd4824.zip |
Nice bmp
Diffstat (limited to '')
-rw-r--r-- | src/ft_hex_to_rgb.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/ft_hex_to_rgb.c b/src/ft_hex_to_rgb.c new file mode 100644 index 0000000..03e9643 --- /dev/null +++ b/src/ft_hex_to_rgb.c @@ -0,0 +1,25 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_hex_to_rgb.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:28:58 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:28:58 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <cub3d.h> +#include <stdint.h> + +t_rgb + ft_hex_to_rgb(int32_t color) +{ + t_rgb rgb; + + rgb.r = ((color >> 16) & 0xff) / 255.0; + rgb.g = ((color >> 8) & 0xff) / 255.0; + rgb.b = ((color) & 0xff) / 255.0; + return (rgb); +} |