aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_darken_rgb.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_darken_rgb.c')
-rw-r--r--src/ft_darken_rgb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_darken_rgb.c b/src/ft_darken_rgb.c
index 97d0c0e..3587d72 100644
--- a/src/ft_darken_rgb.c
+++ b/src/ft_darken_rgb.c
@@ -15,12 +15,15 @@
#include <stdio.h>
uint32_t
- ft_darken_rgb(t_rgb rgb, int32_t y, t_cub *cl)
+ ft_darken_rgb(t_rgb rgb, t_cub *cl)
{
t_rgb darker;
- uint8_t calc;
+ float dist;
+ float calc;
- calc = (((cl->wlist.y_size / 2) + y)),
+ if ((dist = cl->rlist.wall_dist) <= 0)
+ dist = 0.0001;
+ calc = (dist * 0.2);
calc = (calc >= 255) ? (255) : (calc);
calc = (calc < 1) ? (1) : (calc);
darker = rgb;