aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_rgb_to_hex.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_rgb_to_hex.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ft_rgb_to_hex.c b/src/ft_rgb_to_hex.c
new file mode 100644
index 0000000..525296d
--- /dev/null
+++ b/src/ft_rgb_to_hex.c
@@ -0,0 +1,11 @@
+#include <cub3d.h>
+
+int
+ ft_rgb_to_hex(t_rgb rgb)
+{
+ int res;
+
+ res = 0;
+ res += ((rgb.r << 16) + (rgb.g << 8) + rgb.b);
+ return (res);
+}