aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_rgb_to_hex.c
blob: a25d3e0bc617b1c2e2b36e705bcfa49a050700d0 (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
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   ft_rgb_to_hex.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>

uint32_t
	ft_rgb_to_hex(t_rgb rgb)
{
	uint32_t	res;

	res = 0;
	res += ((rgb.r << 16) + (rgb.g << 8) + rgb.b);
	return (res);
}