-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yesim Zaim
committed
Mar 6, 2024
1 parent
bfc6b69
commit 5686045
Showing
3 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: joppe <[email protected]> +#+ */ | ||
/* +#+ */ | ||
/* Created: 2024/02/05 14:01:44 by joppe #+# #+# */ | ||
/* Updated: 2024/03/06 14:25:06 by yzaim ######## odam.nl */ | ||
/* Updated: 2024/03/06 15:02:35 by yzaim ######## odam.nl */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -110,10 +110,10 @@ typedef union s_rgba | |
uint32_t value; | ||
struct | ||
{ | ||
uint8_t a; | ||
uint8_t r; | ||
uint8_t g; | ||
uint8_t b; | ||
uint8_t a; | ||
}; | ||
} t_rgba; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: yzaim <[email protected]> +#+ */ | ||
/* +#+ */ | ||
/* Created: 2024/01/08 15:30:18 by yzaim #+# #+# */ | ||
/* Updated: 2024/03/06 14:25:01 by yzaim ######## odam.nl */ | ||
/* Updated: 2024/03/06 15:02:27 by yzaim ######## odam.nl */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -55,15 +55,15 @@ bool get_colour_value(char *content, t_rgba *col) | |
arr = ft_split(content, ','); | ||
i = 0; | ||
ptr = (uint8_t *) col; | ||
ptr[0] = 255; | ||
while (i < 3) | ||
{ | ||
tmp = ft_atoi(arr[i]); | ||
if (tmp < 0 || tmp > 255) | ||
return (free_2d_array(arr), false); | ||
ptr[i + 1] = tmp; | ||
ptr[i] = tmp; | ||
i++; | ||
} | ||
ptr[i] = 255; | ||
free_2d_array(arr); | ||
return (true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters